We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE

Gets/sets the name of the window.


string = window.name;
window.name = string;


window.name = "lab_view";


The name of the window is used primarily for setting targets for hyperlinks and forms. Windows do not need to have names.

It has also been used in some frameworks for providing cross-domain messaging (e.g., SessionVars and Dojo's dojox.io.windowName) as a more secure alternative to JSONP. Modern web applications hosting sensitive data should however not rely on window.name for cross-domain messaging but instead rather utilize the postMessage API.

Don't set the value to something unstring since its get method will call the toString method.


Specification Status Comment
HTML Living Standard
The definition of 'Window.name' in that specification.
Living Standard  
The definition of 'Window.name' in that specification.

Document Tags and Contributors

 Last updated by: PageYe,