0

I am working on developing a web site for my soon to be formed business, and I decided to develop a single index page where the nav buttons target an iframe instead of a new window. Is there script I can use in any language that would update the title tag of the index page dynamically every time a new target is loaded in the iframe? I would appreciate any input on this. Thank you very much!

Matthew Croft
  • 71
  • 1
  • 2
  • 9

1 Answers1

0

Using jQuery the code would look something like this:

​jQuery(document).ready(function(){
  jQuery('#myframe').load(function(){
    document.title="new title";
  });            
});​

But building your website like this has some serious drawbacks you might want to consider:

  • You will have to think of a way how people will land on the top frame if they find some sub site in their search engine of choice.
  • The changed page title will probably never be used by search engines as you are setting it with javascript (or the first issue applies).
  • Frames/Iframes cause memory leaks in IE (http://stackoverflow.com/questions/8407946/is-it-possible-to-use-iframes-in-ie-without-memory-leaks). This might only be a problem if your top frame will not be reloaded from time to time.
  • There might be problems when people try to print your website.
  • Your visitors might have problems when they try to bookmark a subsite of your website, as only the top frame will be bookmarked (not the content of the iframe).

...and I am sure there are many more issues with such a solution.

csupnig
  • 3,327
  • 1
  • 24
  • 22