Posted by: 2stepsback | April 12, 2007

Who needs AJAX

Now that I’ve got your attention with that title 🙂 let me show you these:
http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index-html.html
and
http://www.enomaly.net/dynapi/examples/dynapi.gui.loadpanel.html

Basically, they use inline frames instead of Updating parts of web pages (DOM nodes) using AJAX. There ought to be many other such scripts as well.

So now, you don’t need to either fear, awe or struggle over AJAX to assemble a page that has parts loading dynamically. You *do* need to know Javascript though. It’s possible that you invest the same amount of time (that you would’ve invested in learning Javascript) in learning popular AJAX techniques instead, but the inline frames idea gives (me for one) a comfortable feel that there already exists a logical structure to do partial dynamic uploading of your web pages. Btw, AJAX is essentially Javascript, so don’t jump. What I mean by “invest time in learning Javascript” is gaining expertise in Javascript like you do in other non-scripting languages like Java and C/C++.

/* My fave Javascript rant start */
[rant]
The single biggest mistake that mot ordinary web developers commit today is to think of Javascript as DHTML. I don’t know of any language called DHTML. I know of Javascript. And it’s not really an operation in assembling Lego blocks. It’s surprising how Javascript editors and IDEs are far less in number than C/C++/Java editors and IDEs. Javascript is *not* Dynamic HTML. There is no “dynamic” HTML. HTML is static. CSS comes to close, but it’s CSS. So you need to *study* and learn Javascript, not just “throw some scripts into the page”.
[/rant]
/* end */

Coming back, you can quickly hack up a set of functions to load any iframe node in your final page with the HTML from a normal HTML file (containing only as much information as is needed for the small rectangle in which it is to be shown), using the url/src property of the iframe. That’s it! You could do it with normal frames as well, as long as you would not get confused.

Then there is the big argument that saving pages and book marking pages becomes a royal pain.

Saving:
One only needs to think a little: you have the DOM with you, you have the DOM of the iframe’s HTML file with you, you know how to traverse DOMs – you can make a separate popup page with all the correct HTML in it and the user can save it
Bookmarking:
Same as above plus a “Bookmark Me” button on your main page or on the popped up page.

Advertisements

Categories

%d bloggers like this: