Brilliant anti-AJAX comment

Pinched in full­text from a com­ment on a post regard­ing Web 2.0 (orig­i­nally writ­ten for FT, so it’s not par­tic­u­larly geeked out).

Such pages, how­ever, tended toward dull­ness and infre­quent updating.

Or, to put it another way: Such pages tended to ful­fill the orig­i­nal vision of the Web, which was to allow absolutely any­one to pub­lish infor­ma­tion that might oth­er­wise be lost to the pub­lic, in a way that allows it to be searched, indexed, book­marked, and linked to related infor­ma­tion. And accessed by absolutely any­body who’s look­ing for it.

As opposed to today’s “dynamic” Web, where you need a broad­band con­nec­tion, an industrial-grade graph­ics work­sta­tion, and more plug-ins than a Roman orgy just to look up the atomic weight of molyb­de­num. Which you can’t book­mark because the URL is a dynamically-generated con­glom­er­a­tion of the host­name, your ses­sion ID, the phase of the moon, and the bra size of the webmaster’s cur­rent girl­friend, that doesn’t point to a page that’s actu­ally stored on disk somewhere.

As nifty as it is that peo­ple have found new ways to make use of HTTP and HTML, we seem to be slowly los­ing the very con­cept of “pub­lish­ing” as “pre­serv­ing a record of today for future recall”. Instead of being the equiv­a­lent of an “address” where one can “go” to retrieve infor­ma­tion, the URL has become a “magic incan­ta­tion” that instructs a dis­tant server to per­form some action that may or may not pro­duce the same results as the last time it was used.

In some ways, that’s good: it’s nice to be able to use the same mech­a­nism to say “Bring up the lat­est edi­tion of Dan’s blog”, “Show me the cur­rent pres­sure and tem­per­a­ture read­ings of Injec­tion Molder #7″, and “Dis­play page 7 from our company’s 2003 annual report”.

But there’s some very scary Orwellian poten­tial here, as well as the risk of exac­er­bat­ing the Dig­i­tal Divide by con­stantly ramp­ing up the min­i­mal plat­form needed to access much of the web. Those librar­i­ans Dan men­tioned lately shouldn’t be the only ones wor­ried about mak­ing sure that a large per­cent­age of online con­tent remains “dull” and “static”.

I think the “Orwellian poten­tial” bit is a load of scare-mongering crap (in rela­tion to the other con­cerns posed in the arti­cle, at any rate), but every­thing else rings true.

I am, at present, work­ing on the first large-scale project I’ve been involved in where <a href=“http://en.wikipedia.org/wiki/AJAX/ title=“Asynchronous JavaScript and XML”>AJAX is being utilised. In this instance, yes, it was my call: yes, I do feel it’s jus­ti­fied (rea­sons include traf­fic, and the advan­tage of not hav­ing to reload an entire page — yes, it’s large scale enough for that to be sig­nif­i­cant — and sim­ple usabil­ity, because the archi­tec­ture is such that users will desire to move quickly between ele­ments of con­tent, and AJAX facil­i­tates that. More details post-release). We’ve been very care­ful to pre­serve func­tion­al­ity in non-XMLHttpRequest enabled UA envi­ron­ments, but it’s still not per­fect — book­mark­ing is one (minor, given the nature of the con­tent) prob­lem that still requires rec­ti­fi­ca­tion: that’s one thing I’m hop­ing to resolve tomor­row (along with gen­eral CSS com­pata­bil­ity back to IE 5, pos­si­bly 4 — but that’s not par­tic­u­larly rel­e­vant). The Javascript is not par­tic­u­larly “unob­tru­sive” (still using inline onclick), which I’m hop­ing to sim­i­larly resolve prior to launch, but it’s not of any par­tic­u­larly great consequence.

This is not a site to be archived, as the author of the com­ment above laments. But he shouldn’t. That wasn’t ever this site’s pur­pose, so I’m not par­tic­u­larly con­cerned if the markup isn’t pres­tine. Yes, there will be RSS/Atom syn­di­ca­tion. It’s a fairly Web 2.0 buzzword-compliant site, though (I hope) not par­tic­u­larly unnec­ces­sar­ily adop­tive of such tech­nolo­gies. We’ll see.

Tags: , , , , , , , , ,

posted on Tuesday, January 17th, 2006 at 9:38 pm by Josh, filed under General.

6 Responses to “Brilliant anti-AJAX comment”

  1. kitten says:

    no no no no!
    the bit about the chang­ing url/uri/whatever it is peo­ple like call­ing them these days for the atomic mass (its actu­ally mass not weight, see­ing as weight changes and mass doesnt… derh) of Molyb­de­num (which hap­pens to be 95.94 Amu) is com­pletely and utterly WRONG! my main rea­son for say­ing this is… with the excep­tion of myself and your­self, mr street, are there actu­ally any web­mas­ters with girl­friends to get a bra size off? and if they dont have girl­friends then it is obvi­ously zero, which means the entire string becomes zero due to the nature of mul­ti­ply­ing any­thing by zero…

    just my two pence worth :P

  2. Matthom says:

    The Javascript is not par­tic­u­larly “unob­tru­sive” (still using inline onclick), which I’m hop­ing to sim­i­larly resolve prior to launch, but it’s not of any par­tic­u­larly great consequence.

    No more inline JavaScript! (I just learned this…) Sep­a­rat­ing behav­iour from con­tent is just as impor­tant as sep­a­rat­ing pre­sen­ta­tion from content.

    Instead of using inline JavaScript, to spec­ify the event, you can use an “event lis­tener,” which “lis­tens” for a par­tic­u­lar event, on a par­tic­u­lar ele­ment (getEle­ment­ById) –and then per­form what­ever func­tion that needs to be performed.

    Yay! I was so happy to finally get rid of inline JavaScript. I hate it. It’s sloppy and I hate “inline anything.”

    I’ll get off my soap­box now. (Sorry, just excited)

    On another note — regard­ing AJAX — I’ve been hav­ing some “orga­ni­za­tion” issues — con­sid­er­ing a typ­i­cal AJAX inter­ac­tion involves so many exter­nal files:

    • The main HTML page
    • The remote script page, which does all the back-end processes, and cre­ates the XML file
    • The JavaScript spe­cific page, for that HTML page, which hold all the AJAX-related functions
    • Any “global” JavaScript files, which hold “global” AJAX related func­tions (re-use of code)
    • And then, of course, the CSS file

    That’s five exter­nal files! I’m work­ing on orga­niz­ing things better.

  3. Josh says:

    It’s not sloppy when all your pages are dynam­i­cally gen­er­ated. In this instance, it would barely even be a page-weight sav­ing to move from onclick events to using an event han­dler, because the anchors clicked to trig­ger AJAX actions need to con­tain two pieces of data as per a GET request… that is, have intrin­sic data attached. I could put this in an ID for each item, in the form id=“x_y”, then parse that out with PHP’s explode() , but it’s not a big deal at all. It’s still acces­si­ble, it’s still usable, and the page has no out­stand­ing need to be archived so I’m not con­cerned about it break­ing twenty years in the future because of JavaScript errors as inline onclick calls a non-existant function!

    Hav­ing said all that, yes, I’m still try­ing to fix it. :)

  4. Lithanya says:

    none of this makes any sense josh, none of the entries what so ever! oh and can i get your home address? i need to send you some­thing :) oooh! surprises!

  5. Josh says:

    Yeah hey… the front page is at present rather dom­i­nated by web geek­ery. Hmm. Email­ing you an address :P

Leave a Reply