madmare
asked on
set iFrame title for the page
Hello Experts,
How do I in my following page, get the iframe title to be the page title
how do I can do it by the Setup function ?
Thanks
How do I in my following page, get the iframe title to be the page title
how do I can do it by the Setup function ?
Thanks
<html><head><title></title>
<script type="text/javascript">
function setup() {
var ifrms = parent.document.getElementsByTagName("aa");
if (ifrms.length > 0) { // We're embedded
parent.document.title = "example";
} else {
document.body.innerHtml = "Content";
}
}
</script>
</head><body onLoad="setup();">
<iframe id = "aa" name = "aa" src='http://www.cnn.com' > </iframe>
</body></html>
This cannot be done in HTML, you could do a curl in php and get the page title and put it between the title tags.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
document.write('<iframe src="http://www.yourwebsite.com/home.html?title='+document.title+'&url='+window.location+'" frameborder="0" scrolling="no"></iframe>');