InAppBrowser

4 posts, 0 answers
  1. Thomas
    Thomas avatar
    14 posts
    Member since:
    Jun 2013

    Posted 24 Jun 2013 Link to this post

    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 ?

  2. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 25 Jun 2013 Link to this post

    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.
  3. Thomas
    Thomas avatar
    14 posts
    Member since:
    Jun 2013

    Posted 25 Jun 2013 Link to this post

    Thanks
  4. Jeff
    Jeff avatar
    1 posts
    Member since:
    Sep 2015

    Posted 10 Mar Link to this post

    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"

Back to Top