"Null" is null or not an object error in IE javascript

Posted by user89691 on Stack Overflow See other posts from Stack Overflow or by user89691
Published on 2010-05-24T23:37:45Z Indexed on 2010/05/24 23:41 UTC
Read the original article Hit count: 375

Filed under:
|
|
|
|

The following code executes fine in Firefox and Chrome, but gives an error:

'null' is null or not an object

when executed in Internet Explorer.

if (xmlhttp.responseXML != null)
    {
    var xmlDoc = xmlhttp.responseXML.documentElement ;
    var ResultNodes = xmlDoc.getElementsByTagName ("Result") ;   <---- error here
    if (ResultNodes != null)
        {

(I would have thought the line after the one indicated would be more likely to return the error but the debugger says the run-time error is at the line indicated)

Any ideas why?

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about error