« XUL Templates and Datasources | Main | WinXP SP2 and ActiveX »
August 30, 2004
HTML Overlays
Glazou implemented XUL Overlays for HTML documents.
I did something similar at AOL (though the code never got used). The idea was having blocks of the HTML page cached and reused around the advanced web application I was working on.
The way I did it was to store the cached parts in javascript files, which would add the data to a global API. In the actual HTML document, you include one .js file, and from js use a syntax like "get_particle('name')", which would basically add a <script> element to the DOM with the src attribute pointing to the .js file. Once the document finished loading, the "particles" would get processed and added to the DOM.
The idea was to be as backwards compatible as possible, so no XML getting and all. I used the same idea to fetch data from the server rather than doing page loads all the time using on-the-fly generated js files from perl. It even worked in Netscape 4!
One benefit is performance - using XML means one has to parse the XML and walk its DOM, etc. The loaded javascript file gets compiled by the javascript engine and presto, the data is useable.
Another benefit is that browsers allow <script> tags to pull in files from any domain, so you won't run into cross domain issues like XMLHttpRequest does. Could be easily considered a security hole, but "fixing" it would break half the web.
The code was destroyed when AOL took my Dell and reformated it when I quit, but it shouldn't be hard to reimplement. Its rather simple and powerfull, and shows the true power of HTML/JS (also called DHTML by uninformed pigs).
As an aside, I keep hearing people say how cool and new Gmail's concept is. But it isn't, people have been doing advanced stuff like that for ages. The real problem is that 98% of web developers have no clue.
Posted by doron at August 30, 2004 10:58 AM
Comments
Actually, we do have clues... just not on the same things. What is blindingly obvious to some of us is something most people wouldn't think of.
Posted by: Alex Vincent at August 30, 2004 1:19 PM
This is very interesting idea. The solution is better than xml island. Can overlay template cross domain? I am also looking the tighten integration.
Posted by: Alex Peng at August 30, 2004 1:26 PM
You can load in .js files from any domain, so yes, it is doable.
Posted by: Doron at August 30, 2004 1:38 PM
Hi!This is my new sites!
http://interiordesign.boom.ru/map.html
2)MY KEYWORD
Posted by: Vlad at November 3, 2004 4:05 AM