0 Replies - 4496 Views - Last Post: 12 January 2013 - 09:18 PM

#1 sdla4ever  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 55
  • Joined: 26-September 11

Run script on url click problems

Posted 12 January 2013 - 09:18 PM

Ok so I am using the Apache Cordova APi to develop a HTML5 iOS app. I want a script that will allow me to open a link in the InAppBrwoser when the url is clicked. The piece I currently have just opens it when it gets the device is ready alert. Can someone help me set this up to where when a specific url is clicked it is opened in the InAppBrowser, or set it up to where all external links are opened in the InAppBrowser is preffered even more.

Thank You

document.addEventListener("deviceready", onDeviceReady, false);

    // Cordova is ready
    //
    function onDeviceReady() {
         var ref = window.open('http://apache.org', '_blank', 'location=yes');
         ref.addEventListener('loadstart', function() { alert('start: ' + event.url); });
         ref.addEventListener('loadstop', function() { alert('stop: ' + event.url); });
         ref.addEventListener('exit', function() { alert(event.type); });
    }



Is This A Good Question/Topic? 0
  • +

Page 1 of 1