Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE9 AngularJs issue:Unable to get value of the property 'nodeName': object is null or undefinedundefined

Tags:

angularjs

Getting this error when a page is being loaded with angular js in IE9. No issues with Chrom/FF.

"Unable to get value of the property 'nodeName': object is null or undefinedundefined"

Any pointers would help.I thought this was fixed as part of Angular js 1.0.1 release.

like image 424
Aki Avatar asked Oct 29 '12 09:10

Aki


3 Answers

I got this error in IE9 when I accidentally had the following illegal markup.

<table>
   <h3>foo</h3>

    ..... blah

</table>

Maybe run a html lint to make sure you're not violating any rules like that.

like image 145
Matthew Tschiegg Avatar answered Oct 19 '22 16:10

Matthew Tschiegg


The problem was:

<table>
    <tr ng-repeat="p in list">
        <td>{{p.f1}}</td> {{p.f2}}
    </tr>
<table>

Remember <tr> should contain only <td> tag not any another tag or raw text according to the HTML specification. Modern browsers (including IE 10) can deal with that mistake but in IE 9 angular raises an error.

like image 45
Sergey Metlov Avatar answered Oct 19 '22 18:10

Sergey Metlov


Most probably you messed up with the syntax inside the

<table> <SOMETHING> </table>

I suggest you copy the DOM from browser and do a check on the https://validator.w3.org/check . Look for errors like : document type does not allow element "SOMETHING" here; missing one of "TH", "TD" start-tag .

like image 28
LeOn - Han Li Avatar answered Oct 19 '22 16:10

LeOn - Han Li