简体   繁体   中英

PhoneGap Cordova > 3.1.0 inAppBrowser not working

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"

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

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

instead of

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

Can you check your code for this issue?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM