Note that there are some explanatory texts on larger screens.

plurals
  1. POError in jquery attribute selector and IE6-7
    primarykey
    data
    text
    <p>I'm trying to implement a JQuery script to process some areas inside an image map. I'm using $('area[shape="poly"]') as a selector to obtain the areas I'm interested in. It is working fine in IE8 and Firefox, but it is not selecting the elements in IE6 or IE7.<br> This is a test page that shows this problem. I don't know if this is a JQuery bug or I am doing something wrong.</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ $(document).ready(function() { var areas = $('area[shape="poly"]'); alert('areas: ' + areas.length); }); //]]&gt; &lt;/script&gt; &lt;title&gt;Test&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;img id="img1" src="nothing.gif" style="width:300px; height:300px; border: 2px solid black" usemap="#map1"/&gt; &lt;map id="map1"&gt; &lt;area shape="rect" title="rectArea" coords="126,112,231,217" alt=""/&gt; &lt;area shape="poly" title="polyArea1" coords="274,72,262,70,251,68,240,67,228,66,217,67,206,68,194,70,183,72,181,63,192,60,204,58,216,57,228,56,240,57,252,58,264,60,276,63" alt=""/&gt; &lt;area shape="poly" title="polyArea2" coords="241,194,235,193,228,193,222,193,216,194,196,119,204,117,212,116,220,115,228,115,237,115,245,116,253,117,261,119" alt=""/&gt; &lt;/map&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>This is showing 2 in IE8 and Firefox and 0 in IE6-7<br> Thanks, Guillermo</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload