<html> <head><title>hopefully this won't be displayed</title></head> <body><iframe style="border:0" src="http://example.com/" width="100%" height="100%" /> </body> </html>
Now, lets say that I open up this page in my browser. How can I make it so that my browser's title-bar displays the contents of the element of http://example.com/ instead of the element of my document that I have here?
Ideally you would find a solution which doesn't require an iframe (what are you serving to people who have them disabled?).
If the iframe is not from the same domain as the parent, any decent browser should block manipulation of the parent's title because it would represent a cross-site scripting exploit.
I think that this would usually be done using some form dynamic (automated) system - in this case if you have a system that is automagically "fetching" the
src then it would be able to fetch the header from http://example.com also as a separate variable.
Otherwise you would be coding in the
src by hand anyway and so it wouldn't seem like a difficult leap to hand-code the title also.
Correct me if I'm wrong but the following code is completely dysfunctional:
<title><iframe ... / ></title>
Is you example dynamic or are you putting in the content details by hand?