I have a jQuery selector that queries elements by name and tag class. In a query that I expect to return three elements, Safari (v3.1.1 for Windows) returns an additional element.
The reason appears to be the numeric identifier *. Changing the identifier to non-numeric excludes the duplicate element. Oddly enough, changing the identifier of the first element to other numbers has an apparent random effect on the final result. Identifier 4 increases the number of results to five. 0, 9, and 1234 all return four elements.
<div class="mydiv" id="1"></div>
<div class="mydiv" id="2"></div>
<div class="mydiv" id="3"></div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
$(function()
{
var div = $('div.mydiv');
alert( div.length );
alert( $.unique( div ).length );
} );
</script>
Firefox 3 and IE 7 display 3 in both warning blocks.
* , HTML. jqGrid, , . , , .
, jqGrid. , , .