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. :)

enter image description here

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

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -