Ios5 参考错误:Can';找不到变量:ChildBrowser、Cordova 1.7.0、jQueryMobile 1.0.1、iOS 5.1
我正在开发我的第一个PhoneGap/Cordova应用程序,并使用jQueryMobile。我正在尝试让ChildBrowser插件工作,但在尝试调用时,标题中出现了错误Ios5 参考错误:Can';找不到变量:ChildBrowser、Cordova 1.7.0、jQueryMobile 1.0.1、iOS 5.1,ios5,jquery-mobile,cordova,phonegap-plugins,Ios5,Jquery Mobile,Cordova,Phonegap Plugins,我正在开发我的第一个PhoneGap/Cordova应用程序,并使用jQueryMobile。我正在尝试让ChildBrowser插件工作,但在尝试调用时,标题中出现了错误 ChildBrowser.install() 它在我的onDeviceReady函数中被正确调用,我甚至通过添加一个警报并将该文件的匿名函数包装在try/catch中来验证是否调用了ChildBrowser.js文件,并且它在执行过程中似乎没有抛出任何错误。但是,var在我的index.html文件中似乎无效 想必这里有一
ChildBrowser.install()
它在我的onDeviceReady函数中被正确调用,我甚至通过添加一个警报并将该文件的匿名函数包装在try/catch中来验证是否调用了ChildBrowser.js文件,并且它在执行过程中似乎没有抛出任何错误。但是,var在我的index.html文件中似乎无效
想必这里有一些我不知道的“抓到你了”。有什么想法吗
提前感谢。结合他的信息和链接帖子,似乎
ChildBrowswer.install();
这一步骤已不再必要。我现在也在使用jquerymobile1.1。用于在下面包含的儿童浏览器中启动google的示例函数。我从第一个链接开始遵循.plist设置
function onLinkClick() {
window.plugins.childBrowser.onLocationChange = function(loc){ alert("In index.html new loc = " + loc); };
window.plugins.childBrowser.onClose = function(){alert("In index.html child browser closed");};
window.plugins.childBrowser.onOpenExternal = function(){alert("In index.html onOpenExternal");};
window.plugins.childBrowser.showWebPage('http://www.google.com',
{ showLocationBar: true });
console.log(window.plugins.childBrowser);
}
以及链接本身的完整性
<p><a href="#" onclick="onLinkClick()">Click here</a> to open a child browser window to Google</p>
打开Google的子浏览器窗口
希望这对其他人有所帮助,因为这个问题有好几天没有得到回答