问题
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