且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-11-17 18:30:40

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

Combining info from http://blog.digitalbackcountry.com/2012/03/installing-the-childbrowser-plugin-for-ios-with-phonegapcordova-1-5/ and his linked post https://github.com/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('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>

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

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