Q:

Pitfalls Of Wrapping Menu In iFrame?

Pitfalls Of Wrapping Menu In iFrame?
To save some legwork in the future, changing content on one page versus every page, I was thinking of turning reoccurring sections of my page into "modules". Basically, I made a page with my menu on it (menu.html) and ported it in to my index.html via an iFrame <iframe src="menu.html" width="100%">
Will this work the way I'm thinking it will? Will I lose a lot of speed with this? Are there any obvious reasons why I shouldn't do this? Will the cons outway the pros?
*Note: I plan on putting all modules on one page to reduce Requests, and then just preposition the content in the iFrame (like a Sprite Sheet)
jsFiddle:

menu.html - http://jsfiddle.net/z6awcy6g/
index.html - http://jsfiddle.net/3r9ukgvz/1/

A:

To answer your question specifically, the main "pitfall" is that the menu simply won't work. When you click on a link in an iframe it opens the link in the frame (unless you specify target="top").
If you have PHP available (basically every host supports it), you can use includes instead. This is the correct way to implement this.

