Question

I'm using cordova 3.3 with InAppBrowser plugin. When i call

ref = window.open('http://www.google.de', '_blank', 'location=yes');

in my onDeviceReady ready function all is fine.

But i have a second function, i called it after onDeviceReady is finished.

function LinkDropBox() {
  ref = window.open('http://www.google.de', '_blank', 'location=yes');
}

error console told me: uncaught typeerror property 'open' of [object global] object is not a function

Any ideas to fix it?

i already tried

typeof window.open

in LinkDropBox and onDeviceReady function

  • In onDeviceReady it returns "function"
  • in LinkDropBox it returns "string"
Was it helpful?

Solution

I'm going to guess that you are overwriting window.open by forgetting the var keyword in front of a local variable, e.g.

function doSomething() {
  open = "hello world";
}

instead of

function doSomething() {
  var open = "hello world";
}

Can you check your code for this issue?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top