PDA

View Full Version : Menu include (no ajax, no innerHTML, no document.write, no iframe (in non-IE)



molendijk
05-03-2010, 03:03 PM
1) CODE TITLE:
Putting a menu on every page of your site
(no ajax, no innerHTML, no document.write, no iframe (except in IE)).

2) AUTHOR NAME: Arie Molendijk

3) DESCRIPTION:
This include technique uses a specific way of adding external pages contained in a text/html object (non-IE) or an iframe (IE) to a file containing a menu. As the external pages 'come to' the (page containing the) menu, not the other way around, we don't have to include the menu: it's always there.
Although we never leave the page containing the menu, the url in the address bar changes each time we add an external file (contained in an object / iframe) to the page. So bookmarking our pages won't cause any problem.
A major advantage of this include method is that we don't have to import any code belonging to the menu page when we go to another page (because, in fact, we never leave the main page (the menu page)).
I used a similar technique here (http://www.dynamicdrive.com/forums/blog.php?b=16), but that one relied on document.write. In the proposal made here, we use appendChild.

4) URL TO CODE:
http://www.let.rug.nl/molendyk/include_passing_data/index.html