This is a migrated thread and some comments may be shown as answers.

InAppBrowser

3 Answers 74 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Thomas
Top achievements
Rank 1
Thomas asked on 24 Jun 2013, 06:27 PM
Hi , 

your example code for InAppBrowser is  great  (https://github.com/Icenium/sample-in-app-browser).

In my application i want to open each link "InApp". So i use " class='share' " on all the links like : 

<a class="share" href="monlien1">facebook</a> 
<a class="share" href="monlien2">twitter</a> 
<a class="share"href="monlien3">google</a>

and replace  getElementbyId :  share=document.getElementsByClassName("share");

But it doesn't work. Why ?

3 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 25 Jun 2013, 06:40 AM
Hi Thomas,

I'm not sure why this might not work on your end, but have you modified your code to account that document.getElementsByClassName() returns an Array and not a single DOM element like document.getElementbyId()

Also you can try to run this in the simulator and see whether there are some JavaScript errors.

Hope this helps,
Stefan Dobrev
Telerik

Looking for tips & tricks directly from the Icenium team? Check out our blog!
Missed our first webinar, watch it here.
Share feedback and vote for features on our Feedback Portal.
0
Thomas
Top achievements
Rank 1
answered on 25 Jun 2013, 08:28 AM
Thanks
0
Jeff
Top achievements
Rank 1
answered on 10 Mar 2017, 11:11 PM

Calling web application's inline javascript from InAppBrowser

As part of an existing web application we have inline/embedded javascript functions.
var ref = cordova.InAppBrowser.open(url, target, options);
Here, unable to call these javascript functions .
Tried the following js_image_succeded(); //directly

also ref.executeScript({ code: "js_image_succeded()"});
it says I/chromium: [INFO:CONSOLE(314)] "Uncaught ReferenceError: js_image_succeded is not defined"

Tags
Apache Cordova
Asked by
Thomas
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Thomas
Top achievements
Rank 1
Jeff
Top achievements
Rank 1
Share this question
or