【问题标题】:Javascript SecurityError: DOM Exception 18 while accessing cookiesJavascript SecurityError:访问 cookie 时出现 DOM 异常 18
【发布时间】:2015-02-19 17:59:37
【问题描述】:

各位, 我正在为 LGTV 开发 WebOS 应用程序。在以前的版本中,我的代码在访问 cookie 时运行良好,但使用更新的 WebOS,它给了我如下错误:

谁能帮我解决这个问题?

谢谢

编辑

这是我尝试在 JS 控制台中访问 c​​ookie 时的输出:

【问题讨论】:

    标签: javascript html webos securityexception domexception


    【解决方案1】:

    我看到您正在通过 file:// 加载应用程序进行测试。 Cookie 不适用于 file:// 网址。请参阅此 StackOverflow 答案:Uncaught Error: SECURITY_ERR: DOM Exception 18 when I try to set a cookie

    【讨论】:

    • 我已经通过使用 localStorage 而不是 cookie 实现了这一点。
    猜你喜欢
    • 2012-04-08
    • 2015-10-09
    • 1970-01-01
    • 2011-02-11
    • 1970-01-01
    • 1970-01-01
    • 2011-07-27
    • 2014-04-13
    • 2013-01-09
    相关资源
    最近更新 更多