InAppBrowser event.url always undefined

邮差的信 提交于 2019-12-11 11:16:45

问题


Do you have any idea why event.url always undefined? This is for loadstart and loadstop.

The google page was displayed fine on pop up window.

var ref = window.open('http://google.com', '_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); });

回答1:


var ref = window.open('http://google.com', '_blank', 'location=yes');
ref.addEventListener('loadstart', function(event) { alert('start: ' + event.url); });
ref.addEventListener('loadstop', function(event) { alert('stop: ' + event.url); });
ref.addEventListener('exit', function(event) { alert(event.type); });

The callback function is called when the event is fired. The function is passed an InAppBrowserEvent object.



来源:https://stackoverflow.com/questions/20369519/inappbrowser-event-url-always-undefined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!