Alex Barnett blog

Stuff

JavaScript crazy talk!

Mike Dierken pointed yesterday to this 1998 article by Greg Travis where Travis proposed that we look JavaScript at in a different way to how it was popularly used at the time, and argued that JavaScript had the potential to provide a more responsive experience over the web:

"In particular, we are going to forget the assumption that a Web page is loaded directly from a Web server. Instead, we are going to use the request/response structure of the Web in a slightly different way. We are going to have the server script send the browser a page that is nothing but JavaScript code. This code, when executed, will stuff new information into data structures which can be used and displayed by the rest of the program. That is, the purpose of the server call is to simply to get raw data from the server."

Crazy talk? No, no, this is crazy:

"Admittedly, this is an unusual use of JavaScript. But all we have done is to treat JavaScript like the thing it is -- a fully functional programming language. If JavaScript doesn't have what you need -- threading, or remote procedure calls, for example -- you can always create it yourself."

Posted: Nov 18 2006, 08:36 AM by alexbarnett | with 2 comment(s)
Filed under:

Comments

Steve Eisner said:

Very insightful article - and way ahead of its time.  All my recent web applications do exactly that - they initially send a lot of Javascript (and CSS, which is another language...) and then use the rest of the HTML - which is just a set of DIVs - as a series of templates to be manipulated via the DOM.

One problem with this method is that you have to work harder to make things accessible.  But I'm not particularly worried about non-Javascript browsers, to be honest.  Just screen readers etc.

# November 18, 2006 12:50 PM

Richard Harrison said:

Greg Travis: "I told you so".

Thanks for the link Alex.

# November 18, 2006 3:11 PM