Internet Explorer not rendering javascript properl

2019-09-22 04:17发布

This question already has an answer here:

I got ran into a small problem but can not figure out why it is happening. On internet explorer 9 and above the following code is rendering as it should be as given below

<div class="nav-bar">

but in internet explorer 8 its display this

<DIV class=nav-bar jQuery18306474608844609571="10">

please help and thanks

1条回答
淡お忘
2楼-- · 2019-09-22 04:36

This is expected behavior. Its how jQuery identify different DOM-notes when you for instance wants to store data on a node:

 $(node).data('a', true);

Instead of storing the data identifier on the node it sets it as an attribute in IE8 to avoid trouble with the Garbage Collector.

In modern browsers jQuery stores the identifier directly on the node.

Look in the source code under function internalData( elem, name, data, pvt /* Internal Use Only */ ){

查看更多
登录 后发表回答