javascript - I want to print parent url in my iframe. Is it possible? -
i want print parent domain name in iframe. possible? share idea. in advance. :)
parent page
<html><head><title></title></head> <frameset border="0" rows="100%,*" cols="100%" frameborder="no"> <frame name="topframe" scrolling="yes" noresize src="http://test.com/test.php"> <frame name="bottomframe" scrolling="no" noresize></frameset> </html>
iframe page (test.php)
<body> <h1 align="center">parent domain name</h1> </body>
you pass whatever value php page , output within frame view?
<frame name="topframe" scrolling="yes" noresize src="http://test.com/test.php?domain=mydomain.com">
then in test.php
<h1 align="center"><?php echo $_get['domain']; ?></h1>
alternatively,
you try using window.parent.document.location.href
javascript mentioned putvande. use document.writeln
or jquery add value page. domain name like: window.parent.document.location.href.split("/")[2]
.
Comments
Post a Comment