Wednesday, April 8, 2009

External HTML (dynamic menu anyone?)

A simple technique I have implemented after some research (and confirmation that YES in fact it is SEO search friendly):

I have a external javascript file with my menu structure (menu_structure.js) that is included in my menu
for each of the 100+ html pages as such:



my menu_structure.js file looks a little like this (I have truncated and murdered it so I'm not showing 2 million lines):

document.write('');

its super simple and straight forward, make a javascript file that uses the DOM to document.write your html code that is the menu structure and include that file in every html page; rock and roll! now when you want to add/delete a menu item you can edit menu_structure.js rather that 100+ html pages *gasp!*. NOTE: my menu has a multitude of javascript functions and CSS styles that are also external files, this blog simply tells how to include the structure; peace!