Javascript SecurityError:访问cookie时DOM异常18 [英] Javascript SecurityError: DOM Exception 18 while accessing cookies
问题描述
伙计们, 我正在为LGTV开发WebOS应用程序.在以前的版本中,我的代码在访问cookie时工作正常,但是使用更新的WebOS时,出现以下错误:
Folks, I am working on WebOS Application for LGTV. In previous version my code was working fine while accessing cookie, but with updated WebOS it is giving me error as following:
有人可以帮我吗?
谢谢
编辑
这是我尝试在JS控制台中访问cookie时的输出:
Here is the output when I try to access cookie in JS Console:
推荐答案
我看到您正在通过file://加载应用程序以进行测试. Cookies不适用于file://网址.请参阅以下StackOverflow答案:未捕获的错误:SECURITY_ERR:尝试设置Cookie时,DOM异常18
I see you are loading the app via file:// for testing. Cookies don't work for file:// urls. See this StackOverflow answer: Uncaught Error: SECURITY_ERR: DOM Exception 18 when I try to set a cookie
这篇关于Javascript SecurityError:访问cookie时DOM异常18的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!