0

我正在構建一個使用inapp瀏覽器從網站上在線繪製內容的PGB的phonegap項目,我想要抓取一些加載的內容在inapp瀏覽器中保存,供用戶在應用程序中離線訪問。 我已經設法發佈數據到網站並得到一個響應,但我不能保存數據的應用程序。如何將Phonegap Inapp瀏覽器內容保存到父應用程序以供脫機查看

function loadStopCallBack3() { 

if (inAppBrowserRef != undefined) { 

    inAppBrowserRef.insertCSS({ code: " .highlight{background-color: yellow !important;}" }); 

    var options = { 
     retrieveLocId : 'FAOR FACT', 

    }; 
    var script2='$("#IAgree").dialog(\'close\');var form = document.createElement("form");form.setAttribute("action","https://www.notams.faa.gov/dinsQueryWeb/queryRetrievalMapAction.do");'; 
    script2+='form.setAttribute(\'method\',"post");'; 
    script2+='var hiddenField = document.createElement("input");hiddenField.setAttribute("type", "text");hiddenField.setAttribute("name", "retrieveLocId");hiddenField.setAttribute("value", "FAOR");form.appendChild(hiddenField);'; 
    script2+=' hiddenField = document.createElement("input");hiddenField.setAttribute("type", "text");hiddenField.setAttribute("name", "reportType");hiddenField.setAttribute("value", "Report");form.appendChild(hiddenField);'; 
    script2+=' hiddenField = document.createElement("input");hiddenField.setAttribute("type", "text");hiddenField.setAttribute("name", "actionType");hiddenField.setAttribute("value", "notamRetrievalByICAOs");form.appendChild(hiddenField);'; 
    script2+='form.submit();'; 

    inAppBrowserRef.executeScript(
    { code : script2}, 
     function(returnval){ 
     console.log("----------------->"+returnval);         
     } 

    ); 

    inAppBrowserRef.show(); 
} 
} 

回答

0

根據數據的大小以及使用的類型,你可以簡單地將數據存儲在localstorageweb sql.

兩者在HTML5和PhoneGap的應用程序支持,並且可以離線訪問。

相關問題