Created
May 13, 2015 17:29
-
-
Save EricDavies/f1104b101347419306e7 to your computer and use it in GitHub Desktop.
getting parent url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title> child</title> | |
</head> | |
<script type="text/javascript"> | |
function dumpit() { | |
var div = document.getElementById("dumpzone"); | |
var parentUrl; | |
if (parent !== window){ | |
parentUrl = document.referrer; | |
} | |
else { | |
parentUrl = "not in iframe"; | |
} | |
div.innerHTML = parentUrl; | |
} | |
</script> | |
<body onload="dumpit();"> | |
child-above | |
<div id="dumpzone">Empty</div> | |
child-below | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>parent </title> | |
</head> | |
<body> | |
parent top<br> | |
<iframe src="http://ssh.priologic.com:8080/child.html"></iframe> | |
parent bottom<br> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment