【问题标题】:android - html5 localstorage issueandroid - html5 本地存储问题
【发布时间】:2011-10-11 02:14:12
【问题描述】:

在 android 中渲染 HTML5 页面时,我使用了 HTML5 的 localStorage。

localStorage["temp"] = "test";

对于上面的行,它给出了错误:TypeError: 'null' is not an object (evalating 'localStorage["temp"] = "test"').

(它在 browsers-chrome 或 firefox 中完美运行,在html5 storage 页面上写它支持 android 2.0+)

【问题讨论】:

    标签: android html local-storage


    【解决方案1】:

    尝试将其设置为您的 webview 设置:

    yourWebViewObject.getSettings().setDomStorageEnabled(true);
    

    【讨论】:

    • saurabh 试试这样 localStorage.setItem("foo","thanks"); alert(localStorage.getItem("foo"));感谢 christophecvb,它帮助了我
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-09
    • 1970-01-01
    • 2020-04-22
    • 1970-01-01
    相关资源
    最近更新 更多