I have Dynamically Loaded image hot zones in the past few days. I used Ajax to obtain the area tag. Here there are multiple areas, which can be tested normally in IE8 and FF, and ie6.
Later I found that the append method in jquery is not easy to add HTML to tags, and the following problems will occur.
First, give me the code to get the hot zone.
Below is the hot HTML
Copy codeThe Code is as follows:
<% = ViewState ["ID"] %> "width =" 930px "usemap =" # Map "border =" 0 "id =" NodeImage "/>
<Map name = "Map" id = "Map"> </map>
The result is as follows:
1. The correct code I want
2. Incorrect code
The above two results are from IETEST.
Previously, I used the $ ("# Map" ).html (); method to obtain the hot zone. The problem in Figure 2 can always occur.
Later I used alert ();After testing, the result is correct,You can solve the problem by using innerHtml () directly, that is, the line of Code that is commented out at the top.
In fact, sometimes Javascript is better compatible with some of its own things, depending on the needs. Jquery is not omnipotent!
This may be a Bug in jquery. It's just my personal opinion. It's for your reference only!