2012-07-29 10 views
0

phonegap 2 window.plugins는 더 이상 사용할 수 없지만 childBrowser는 여전히 의존합니다. phonegap 2 프로젝트에서 childBrowser 플러그인을 호출하려면 어떻게해야합니까? phonegap 2.0이있는 childbrowser

1.9에서 잘 작동했다 : 모든

cb = window.plugins.childBrowser; 
+0

해결책은 무엇입니까? jQuery를 사용하십시오. –

답변

1

첫 번째는 2.0.0 버전

에게 https://github.com/phonegap/phonegap-plugins/tree/8848e8dd7f0d93810eec49fb1124f6389c963b68/Android/ChildBrowser

사용 여기에서 최신 자식 브라우저를 다운로드 한 플러그인이 객체를 생성 window.plugins.childBrowser. 사용하려면 다음 방법 중 하나를 사용하십시오.

/** 
    * Display a new browser with the specified URL. 
    * This method loads up a new web view in a dialog. 
    * 
    * @param url   The url to load 
    * @param options  An object that specifies additional options 
    */ 
    showWebPage(url, [options]) 
Sample use: 

window.plugins.childBrowser.showWebPage("http://www.google.com", { showLocationBar: true }); 
    /** 
    * Close the browser. 
    */ 
    close() { 
Sample use: 

window.plugins.childBrowser.close(); 
    /** 
    * A user supplied call back which is run when the browser is closed. 
    */ 
    onClose() 
Sample use: 

window.plugins.childBrowser.onClose(); 
    /** 
    * A user supplied call back which is run when the browser location changes. 
    * The method is called with the new location of the browser. 
    */ 
    onLocationChange(location) 
Sample use: 

window.plugins.childBrowser.onLocationChange(location); 
    /** 
    * Display a new browser with the specified URL. 
    * 
    * NOTE: If usePhoneGap is set, only trusted PhoneGap URLs should be loaded, 
    *  since any PhoneGap API can be called by the loaded HTML page. 
    * 
    * @param url   The url to load 
    * @param usePhoneGap Load url in PhoneGap webview [optional] - Default: false 
    */ 

    openExternal(url, [usePhoneGap]) 
Sample use: 

window.plugins.childBrowser.openExternal("http://www.google.com"); 
관련 문제