- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using Intel XDK 2611. I added the InAppBrowser plugin (cordova-plugin-inappbrowser) to my project and try to use it like this on iOS/IPad:
<span class="link" onclick="window.open('http://www.intel.com', '_blank');">Intel</span>
On the emulator everything is fine, but while testing the app using App Preview (either Mobile or Wifi), 9 times out of 10 the link will open in the app window, making it impossible for the user to go back. Sometimes, rarely, it will work as expected and present a "Done" button and navigation.
While trying to debug the problem, I noticed that InAppBrowser would always work as expected if I had the WEINRE tag as the first thing in my HTML. I have the cordova.js tag in my HTML, and tried to place it in various spots across the code with no success.
Is this an App Preview problem? Why would it work without problems just by having the WEINRE tag? What can I do?
- Tags:
- HTML5
- Intel® XDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
WEINRE will slow down your app, so there may be a timing issue. I recommend that you do not use the inline onclick approach to adding a handler, and instead give the div an ID and then attach your click handler using JavaScript in a JS file. See how that is done in the "Blank Cordova Starter App" under "Samples and Demos" in the "General" category, under the "HTML5 + Cordova" section... there's a button there that get's hooked up using the technique I'm describing.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
WEINRE will slow down your app, so there may be a timing issue. I recommend that you do not use the inline onclick approach to adding a handler, and instead give the div an ID and then attach your click handler using JavaScript in a JS file. See how that is done in the "Blank Cordova Starter App" under "Samples and Demos" in the "General" category, under the "HTML5 + Cordova" section... there's a button there that get's hooked up using the technique I'm describing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Paul, your answer set me on the right path.
The problem was that I was runing code before the device was ready. As soon as wrapped all my code in a function and called that function inside the "onDeviceReady" event handler, everything worked.
Thanks again!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page