Questions tagged [window.parent]

The window.parent is a reference to the parent window of the window that this script is executed in.

The window.parent is a reference to the parent window of the window that this script is executed in. The window.parent can be used when in a frame or iframe - in all other cases there is no parent window, and that reference will be undefined.

20 questions
8
votes
1 answer

Firefox window.parent.location

I've a Html page index.htm which has an iframe to page search.htm the search.htm has code like this function executeSearch() { window.parent.location = "/SearchResults.aspx?t=" + txt_Search.value; } this code executed now from…
Mustafa Magdy
  • 1,230
  • 5
  • 28
  • 44
3
votes
3 answers

Why does window.parent self-reference?

I understand from documentation and several related StackOverflow posts that window.parent, if there is no other parent, will self-reference and thus never be undefined. I can't seem to find a decent reason as to why this is. JavaScript does have…
Cellivar
  • 568
  • 10
  • 27
2
votes
0 answers

window.parent and window.top are suddenly equal to window.self

I have a web app (B) which is hosted in another application (A) using an Iframe. My web application can without problems post messages (parent.postMessage(“my message", “*”)) to the parent, B. My app has a link which points to an external web…
Hank Rearden
  • 87
  • 1
  • 1
  • 10
2
votes
0 answers

postMessage from child to parent window in Safari using window.open

I'm using window.open(...) to open a completely new window (same domain, same subdomain, same directory, same everything, but a different .html file). In the child window, I'm using this to send messages back to the…
Steverino
  • 2,099
  • 6
  • 26
  • 50
2
votes
1 answer

mraid.expand() not working properly in DoubleClick studio

I'm trying to upload a mraid project to Google's DoubleClick studio and notice the mraid.expand() event is not working properly. The ad is meant to be an in-app expandable banner, and basically after the very first time, mraid.expand() will not…
beichenfan
  • 151
  • 1
  • 6
1
vote
1 answer

IE8+, window.open(url/#/frag,'_parent') vs. parent.location.href=url/#/frag in iframe

I have a site that loads an iframe. Code in the parent window registers an onbeforeunload listener. Currently the iframe contains a button with a click handler that fires off: window.open(/#/frag,'_parent') In all browsers I have tested (besides…
mjj1409
  • 3,075
  • 6
  • 28
  • 28
1
vote
3 answers

Legacy code: window.parent.location.href="https:/home"

I have inherited some code from our former developer and I found this piece of code. loginAction->isAuthenticated()){ ?>