cordova - JavaScript Redirect doesn't work windows mobile app -
hey guys have error when try redirect page in windows mobile app: error:
apphost9624:the app can't use script load https://google.com url because url launches app. direct user interaction can launch app.
code used in js file:
window.open('https://google.com');
i tried install cordova inappbrowser plugin, after code like:
var app = { // application constructor initialize: function() { this.bindevents(); }, // bind event listeners // // bind events required on startup. common events are: // 'load', 'deviceready', 'offline', , 'online'. bindevents: function() { document.addeventlistener('deviceready', this.ondeviceready, false); }, // deviceready event handler // // scope of 'this' event. in order call 'receivedevent' // function, must explicitly call 'app.receivedevent(...);' ondeviceready: function() { app.receivedevent('deviceready'); }, // update dom on received event receivedevent: function(id) { var parentelement = document.getelementbyid(id); var listeningelement = parentelement.queryselector('.listening'); var receivedelement = parentelement.queryselector('.received'); var ref = window.open('https://google.com', '_self', 'location=no') listeningelement.setattribute('style', 'display:none;'); receivedelement.setattribute('style', 'display:block;'); console.log('received event: ' + id); } }; app.initialize();
but still doesn't work i've tried:
windows.location.href = "https://google.com"; location.href = "https://google.com";
i compiled app cordova, debug in visual studio 2015.
Comments
Post a Comment