문제

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); });
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top