In answering my question Pumbaa80 found a difference between calling open()
and window.open()
, try the following examples in Firefox
Your two fiddles work the same for me on Chrome.
However, the two lines of code
window.open(...);
and
open(...);
are NOT equivalent. The only time they will be equivalent is if your current executing scope does not provide a new definition for open
, causing the interpreter to look in the higher scopes until it reaches the global scope and finds window.open
.
You can see this in action in this fiddle:
var test = function () {
var open = function () {
alert('uh oh');
};
window.open('www.google.com');
open('www.google.com');
};
test();