Window self Property
When the "Check window" button is clicked, the function check() is called and the current window status is checked. If the topmost window (window.top) is different from the current window (window.self), then output that "This window is not the topmost window! Am I in a frame?". If the topmost window equals the current window, then fire the else statement:
document.write("<p>This window is not the topmost window! Am I in a frame?</p>")
document.write("<p>This window is the topmost window!</p>")
Try it yourself »
Definition and Usage
The self property returns the current window.
The self property is supported in all major browsers.
|Return Value:||A reference to the window object itself|
Thank You For Helping Us!
Your message has been sent to W3Schools.