I have an web app that is basically a wiki. When the content is being shown in a parent window there is a menu bar that I am rendering through server-side code.
What I want to do is sometimes use an IFRAME for this content... but when content is generated in the IFRAME I don't want the menu bar to be generated.
I have been adding a simple "&frame=true" parameter to the URL when initially targeting the IFRAME .src (my server-side code reads this param and doesn't generated the menu bar), but my problem is that when navigating hyperlinks within the IFRAME that this "&frame=true" param is lost obviously... and subsequent pages will have the menu bar again.
What I would like to do is to intercept the hyperlink click (let's assume it's all my domain) using an event handler, and if the parent is the IFRAME, add the "&frame=true" parameter to the URL and then fire the hyperlink and page load normally.
I could dynamically regex the of HTML of pages being shown in the IFRAME and add "&frame=true" to ensure subsequent hyperlink clicks don't generate this menu... but looking for a more elegant and less computational approach.