ERROR / Web控制台:未捕获的类型错误:不能调用方法'的getItem“空的http://m.youtube.com/:844 [英] ERROR/Web Console: Uncaught TypeError: Cannot call method 'getItem' of null at http://m.youtube.com/:844

查看:739
本文介绍了ERROR / Web控制台:未捕获的类型错误:不能调用方法'的getItem“空的http://m.youtube.com/:844的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的错误来自安卓(web视图),而不是直接从我自己的code:

The following error comes from Android (WebView) and not directly from my own code:

04-28 12:36:15.174: ERROR/Web Console(7604): 
  Uncaught TypeError: Cannot call method 'getItem' of null at http://m.youtube.com/:844

我真的没有做什么特别的东西除了加载一个URL到的WebView。大多数时候,我的不要得到这个错误,所以我假定这可能是指向一些不可靠的网络环境?也许youtube.com太忙了?

I am really not doing anything special other than loading that URL into WebView. Most of the time I don't get this error, so I am assuming this could be pointing to some unreliable network conditions? Perhaps youtube.com too busy?

这很难说。无论如何,我想至少有什么可能会导致这和我是否能赶上这个错误,这样我可以更好地处理它的想法。

It's hard to tell. Regardless, I would like to at least have an idea what could be causing this and whether I can catch that error so that I can better handle it.

此外,我自己的code并不知道是什么的getItem 是。在另一方面,出现此问题时,在我的WebView在YouTube页面简直是

Again, my own code has no knowledge of what getItem is. On the other hand, when this problem occurs, the YouTube page on my WebView is simply empty.

感悟?

编辑:我一直在寻找有关文件所提出的 WebSettings.setDomStorageEnabled(真)。唯一的提示我已经能够找到为止WAS <一href="http://stackoverflow.com/questions/4157184/android-making-webview-domstorage-persistant-after-app-closed">in这太线程:正如我前面提到的,出现这种问题很少因为我贴我的问题都没有发生。所以,我必须了解一点关于这一点,DOM存储之间的关系之前,我可以想出一个方法来测试/验证这是否解决了问题。

I have been looking for documentation about the proposed WebSettings.setDomStorageEnabled(true). The only hint I have been able to find so far was in this SO thread: As I mentioned earlier, this problem occurs very rarely and haven't occurred since I posted my question. So I must understand a little more about the connection between this and "DOM storage" before I can devise a way to test/verify whether this solves the problem.

另外,我刚才遇到的另一个错误消息(良性的结果,所以它看起来是):

Also, I just encountered another error message (with benign results, so it seems):

05-02 00:44:45.823: ERROR/Web Console(1595): 
  dojo.back.init() must be called before the DOM has loaded. 
  If using xdomain loading or djConfig.debugAtAllCosts, 
  include dojo.back in a build layer. 
  at http://sj.example.com/ncscript/subsect/j_gs/version/20110428191502.js:164

我现在可以看到一些连接的DOM,所以它看起来像@布赖恩·奥德尔是在正确的方向。我只需要了解 WebSettings.setDomStorageEnabled(真)一样。

推荐答案

也许你需要的东西,如:

Perhaps you need something like:

WebSettings设置= webView.getSettings();

WebSettings settings = webView.getSettings();

settings.setDomStorageEnabled(真);

settings.setDomStorageEnabled(true);

<一个href="http://stackoverflow.com/questions/4930623/webview-causing-uncaught-typeerror-when-loading-www-google-com">source

这篇关于ERROR / Web控制台:未捕获的类型错误:不能调用方法'的getItem“空的http://m.youtube.com/:844的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆