admin 管理员组文章数量: 1086019
We've been seeing this error in our web app the last couple of months:
Uncaught TypeError: Cannot read property 'tagName' of null
First I noticed it was only happening on android phones with 4.0.X, no other OS or version.
To debug this I started by removing code and markup to try and find the culprit.
I did this until I had pletely emptied the document of everything and the problem is still there.
The only clue is the console line before:
Reader :: Recognize :: INFO - Script is evaluating. recognizeArticle Start
Does anyone have any clue of why this is happening?
The problem is we get notified on errors and we can't ignore this since it's happening on a random line and page every time.
I can add that this happens on all our web apps.
To clarify, this is not a problem with our web app, the problem is with android.
I've removed ALL our code and markup and the problem is still there, android is doing something that causes this error.
The phone I've tested on was a galaxy S3.
Since people don't seem to believe me when I say the source is empty:
(develop✗) $ curl -v localhost:3000/us/app
* About to connect() to localhost port 3000 (#0)
* Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET /us/app HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=utf-8
< X-UA-Compatible: IE=Edge
< Cache-Control: no-cache
< X-Request-Id: c7d96d6898017b5efa7659028008a8b8
< X-Runtime: 0.011019
< Vary: Accept-Encoding
< Content-Length: 0
< Connection: keep-alive
< Server: thin 1.3.1 codename Triple Espresso
<
* Connection #0 to host localhost left intact
* Closing connection #0
We've been seeing this error in our web app the last couple of months:
Uncaught TypeError: Cannot read property 'tagName' of null
First I noticed it was only happening on android phones with 4.0.X, no other OS or version.
To debug this I started by removing code and markup to try and find the culprit.
I did this until I had pletely emptied the document of everything and the problem is still there.
The only clue is the console line before:
Reader :: Recognize :: INFO - Script is evaluating. recognizeArticle Start
Does anyone have any clue of why this is happening?
The problem is we get notified on errors and we can't ignore this since it's happening on a random line and page every time.
I can add that this happens on all our web apps.
To clarify, this is not a problem with our web app, the problem is with android.
I've removed ALL our code and markup and the problem is still there, android is doing something that causes this error.
The phone I've tested on was a galaxy S3.
Since people don't seem to believe me when I say the source is empty:
(develop✗) $ curl -v localhost:3000/us/app
* About to connect() to localhost port 3000 (#0)
* Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET /us/app HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/html; charset=utf-8
< X-UA-Compatible: IE=Edge
< Cache-Control: no-cache
< X-Request-Id: c7d96d6898017b5efa7659028008a8b8
< X-Runtime: 0.011019
< Vary: Accept-Encoding
< Content-Length: 0
< Connection: keep-alive
< Server: thin 1.3.1 codename Triple Espresso
<
* Connection #0 to host localhost left intact
* Closing connection #0
Share
Improve this question
edited Sep 20, 2012 at 14:38
Nicklas A.
asked Sep 20, 2012 at 9:56
Nicklas A.Nicklas A.
7,0617 gold badges43 silver badges67 bronze badges
6
-
1
Where in (your?) code do you attempt to access property 'tagName' of some objects? At the time of this attempt the object itself is null - i.e. the previous attempt to get object actually failed, but was left unchecked. You should be looking for the code like
... someObj.tagName ...
or... someObj["tagName"] ...
– Germann Arlington Commented Sep 20, 2012 at 10:15 - I know what the errors means... As I said the error still occurs when I've emptied the DOM of everything (and I mean everything). – Nicklas A. Commented Sep 20, 2012 at 11:07
- 1 No one would really be able to help you debug your code unless you show the code in question. – rsp Commented Sep 20, 2012 at 11:18
- 1 Did you even read the question, there IS no code, I've removed it all. The problem isn't our code. – Nicklas A. Commented Sep 20, 2012 at 11:35
- 1 I get the same error on an ASP.Net page (Samsung Galaxy S3), but with a line number (Always the same number!): "Uncaught TypeError: Cannot read property 'tagName' of null in line 279". The error occurs after all of my own scripts. – Hugo Commented Sep 28, 2012 at 9:57
3 Answers
Reset to default 1I've found that on Android 4.0.X any page without a div containing at least 10 characters will throw a JavaScript error. The RSS reader apparently assumes that the page will have some content in a div.
I have this error on Chrome for Linux and it was caused by the ImageBlocker extension. Since this "error" occurs for you when you launch a blank page, it reasons that you don't need to fix it. It is a bug with the browser or an extension.
Your question bined with your ments do NOT make sense:
it sounds like you are opening empty page containing no HTML or JavaScript and it generates you an error???
There is some JavaScript function somewhere in your page that runs and
1) attempts to get some object from your DOM
2) fails to do 1) but does NOT handle the error leaving object reference variable set to NULL
3) attempts to use the above object variable to get it's tagName
property.
If the above were not true than you would NOT have an error to ask about.
本文标签: javascriptUncaught TypeError Cannot read property 39tagName39 of nullStack Overflow
版权声明:本文标题:javascript - Uncaught TypeError: Cannot read property 'tagName' of null - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744055942a2525849.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论