From: Benjamin S. <bs...@cr...> - 2005-12-01 22:40:47
|
On Thu, Dec 01, 2005 at 03:33:46PM -0700, Kevin wrote: > > Very good suggestions. I really like changing the link to "Today's > > Unread items". And the ajax stuff sounds intriguing, though I imagine > > you don't actually need Ajax. Or do you actually wait for a server > > response before removing the div from the DOM? (ba-dim-dim :) This > > would be very nice - as long as it degrades to non-js browsers. > > I'm playing with xajax on a side project at work. I'm impressed with how > easy it is to manipulate the DOM from the server side. So with very > little effort we could do exactly what you describe above. An event on > the client sends a request to the server marking an item as read, then the > server sends a response back to the client telling it to hide/remove the > item from the page. All without a refresh on view.php. Nice, huh? This is exactly what I already had implemented. Yes, it waited to remove the div until it got a "confirmed that this is marked as read" from the server, but it could instead be done by just building up a list without actually making the remote call (move the "read" articles down to the bottom of the page into a "read" bin or something). I have not used xajax, but here's what I have used: In my on disk hack against old FOF, I used prototype.js, which was poorly documented and I believe originated out of Rails. I would not use this again. For my last work project, I used Sajax, which I liked a lot because it made it really easy to bind ajax functions to specific php/perl/whatever functions on the server, and it generated all the ajax functions for you, and you were able to specify an arbitrary callback function. I especially liked the ability to specify the arbitrary callback function, because it gave me a lot more flexibility to do exactly what I needed to do. And making it degrade is easy, because we could just make the AJAX read functionality be hidden unless javascript is available to enable it. No matter how I do this, I 1. already have at least one version of it implemented, and 2. it's pretty easy. I'll work on it some tonight. --Benjy |