
Originally Posted by
Twey
By the by, window.open() is a function, not a variable [...]
It's both. All variables, functions declarations, and formal arguments are properties of some object so they can be assigned to just like properties of a user-defined object[1]. For example:
Code:
function myFunction() {}
alert(typeof myFunction); /* function */
myFunction = 'value';
alert(typeof myFunction); /* string */
The open property is just a reference to a host function. Some third-party pop-up blockers operate by assigning their own function to that same property, replacing its functionality.
Mike
[1] There are exceptions. Some built-in properties are read-only where an assignment will be ignored, and host objects are free to act however they like (IE is known to throw exceptions when assigning to some host objects).
Bookmarks