I know on the same page frame or parent I can make either go to something via window.location however is there a means of checking to see if I am in the iframe and if so make the top (parent window) location go somewhere?
asked Jun 7, 2012 at 23:48
chris
37k54 gold badges149 silver badges256 bronze badges
1 Answer 1
This is a simple code to check if your page is loaded in iframe:
if (window.location != window.parent.location)
window.parent.location = "http://someurl";
lang-js