InAppBrowser event.url总是未定义 [英] InAppBrowser event.url always undefined

查看:134
本文介绍了InAppBrowser event.url总是未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你有什么想法为什么event.url总是undefined?这是 loadstart loadstop

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); });

当事件触发时调用回调函数。函数传递一个InAppBrowserEvent对象。

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

这篇关于InAppBrowser event.url总是未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆