licentious radio

December 2002
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Nov   Jan

   Click here to visit the Radio UserLand website.
   Click to see the XML version of this web page.


"What kind of peace do I mean? What kind of peace do we seek? Not a Pax Americana enforced on the world by American weapons of war. Not the peace of the grave or the security of the slave. I am talking about genuine peace, the kind of peace that makes life on earth worth living, the kind that enables men and nations to grow and to hope and to build a better life for their children - not merely peace for Americans but peace for all men and women - not merely peace in our time but peace for all time." -- JFK
 
Home | Stories | Politics/Humor | Web Usability/Humor | ipaq 3800 Linux | RadioRadio | Typography | About | Contact
RadioRadio
Wednesday, December 18, 2002
[7:16:38 PM]     
Follow-up on chronologically-ordered weblogs.... Here's a example of using client-side javascript and cookies to hide previously-viewed posts [new window].

Why are blogs in reverse order? Partly because we don't want the server to remember which items each viewer has already seen. We also don't want the server to do the work of delivering only unseen items for each user. That would get expensive, compared to Radio, that generates static pages.

The script uses client-side memory and processing power, which is scalable. That is, if a million people hit your weblog, the server doesn't have to do any extra work.

The example assumes the server doesn't help by providing variables like the ids of the first and last items on the page. Slightly cooperative weblog software would reduce the complexity of the Javascript code.

[11:43:34 AM]     
Re-ordering weblogs is easy. Give it a separate page. Maybe restrict it to a shorter timespan. Use Javascript and DOM:

1) use Javascript to write a cookie with the id of the last-viewed entry.

2) use Javascript to set "display: none" for the items that have already been read. This will work in fancy new browsers like IE5+, Mozilla, and NS6+. For old and primitive browsers, be sure to include a link to the (current) standard reverse-order page.

3) add a link to display the hidden items.

Not having done this yet, I presume the Javascript won't be entirely straightforward. Ideally, the weblog server software would give you access to variables for the last id, and the ids would have to be numerically ordered. Radio's ids will work.

Of course the server software would have to give you the option. I don't know if any do, but it certainly wouldn't be hard.

Dave Winer provoked this outburst by linking to Ken Hirsch.



Copyright © 2003 Licentious Radio.
Last update: 9/20/03; 2:54:10 PM.