This is my code:
function loadOffer(id) {
window.open("http://www.google.com.com","mywindow");
}
It's initiated onClick. However I get the following error:
Uncaught TypeError: Property 'open' of object [object DOMWindow] is not a function
Any ideas?
You've defined a global variable somewhere called open and it's not a function. It's overridden the normal function of window.open.
Yet another good reason to namespace our javascripts.
Under normal circumstances, window.open is a function. So you've probably changed it somewhere else in the code, most likely by defining a variable open without a var statement.
> window.open
function open() { [native code] }
> open = "test"
"test"
> window.open
"test"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With