I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.
Cisco Certified Network Associate Exam,640-802 CCNA All Answers ~100/100. Daily update
or just:
ReplyDeletevar isEmbed = window != window.parent;
You could use iframe's onload event:
ReplyDelete<html>
<head>
<script type="text/javascript">
function load()
{
alert("Iframe is loaded");
}
</script>
</head>
<iframe onload="load()" src="/page.html">
</iframe>
</html>
You can check if you are in an iframe using this snippet:
ReplyDeletevar isInIframe = (window.location != window.parent.location) ? true : false;
based on that you can continue with your javascript code.
Probably the simplest method:
ReplyDeleteif ( self !== top ) {
// you're in an iframe
}
So, you check if the current window is the topmost window...