参考错误:找不到变量:ChildBrowser,Cordova 1.7.0,jQueryMobile 1.0.1,iOS 5.1

编程入门 行业动态 更新时间:2024-10-21 11:46:58
本文介绍了参考错误:找不到变量:ChildBrowser,Cordova 1.7.0,jQueryMobile 1.0.1,iOS 5.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用我的第一个PhoneGap / Cordova应用程序,并使用jQueryMobile。我试图让ChildBrowser插件工作,但尝试调用

I'm working on my first PhoneGap/Cordova app and using jQueryMobile as well. I'm trying to get the ChildBrowser plugin working but getting the error in the title when trying to call

ChildBrowser.install()

它在我的onDeviceReady函数中被正确调用,我甚至验证了ChildBrowser.js文件被调用通过添加一个警报,并包装在一个try / catch中的文件的匿名函数,它似乎没有在执行期间抛出任何错误。但是var在我的index.html文件中似乎无效。

Its in my onDeviceReady function which is being called correctly and I've even verified that the ChildBrowser.js file is being called by adding an alert and wrapping the anonymous function that file in a try/catch and it does not seem to be throwing any errors during its execution. However the var does not seem to be valid within my index.html file.

大概有一些'gotcha'在这里我不知道。任何想法?

Presumably there is some 'gotcha' here I am not aware of. Any thoughts?

提前感谢。

推荐答案

http:// blog.digitalbackcountry/2012/03/installing-the-childbrowser-plugin-for-ios-with-phonegapcordova-1-5/ 及其关联的帖子 github/phonegap-starter/ChildBrowserPlugin ,似乎

Combining info from blog.digitalbackcountry/2012/03/installing-the-childbrowser-plugin-for-ios-with-phonegapcordova-1-5/ and his linked post github/phonegap-starter/ChildBrowserPlugin it appears that the

ChildBrowswer.install();

步骤。我现在也使用jQueryMobile 1.1。用于在下面包括的ChildBrowser中启动google的示例函数。我从第一个链接跟踪.plist设置。

step is no longer necessary. I am now using jQueryMobile 1.1 as well. Example function used to launch google in the ChildBrowser included below. I followed the .plist setup from the first link.

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('www.google', { showLocationBar: true }); console.log(window.plugins.childBrowser); }

和链接本身完整性

<p><a href="#" onclick="onLinkClick()">Click here</a> to open a child browser window to Google</p>

希望这可以帮助别人,因为这个问题没有回答几天。

Hopes this helps someone else as this question went unanswered for a couple of days.

更多推荐

参考错误:找不到变量:ChildBrowser,Cordova 1.7.0,jQueryMobile 1.0.1,iOS 5.1

本文发布于:2023-11-28 16:34:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643152.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   变量   错误   ChildBrowser   Cordova

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!