Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

window.top.location vs window.location

how to sync window.top.location and window.location?

like image 891
asdf_enel_hak Avatar asked Mar 18 '11 15:03

asdf_enel_hak


People also ask

What is window top location?

top. Returns a reference to the topmost window in the window hierarchy.

What is meant by window location?

The Complete Full-Stack JavaScript Course! Window. location is the location property of a window and it is a reference to a Location object; it represents the current URL of the document being displayed in that window. Since window object is at the top of the scope chain, so properties of the window.

What is the difference between window location and document location?

The window. location is read/write on all compliant browsers. The document. location is read-only in Internet Explorer but read/write in Firefox, SeaMonkey that are Gecko-based browsers.

What is window top?

The Window top() property is used to return the topmost browser window of a current window. It is a read-only property and it returns a reference to the topmost window in the window hierarchy. Syntax: window.top. Return Value: It returns the reference of the topmost window in the window hierarchy.


1 Answers

This is how you set the parent of the frame (top) to the location of the frame document...

top.location = self.location;

Of course, this code must be executed within the iframe, and is succeptible to the Same-Origin Policy.

like image 149
Josh Stodola Avatar answered Sep 23 '22 16:09

Josh Stodola