I was able to reproduce this bug in JQuery 1.2.6, 1.3, and 1.3.1 on
Windows XP with Internet Explorer 7.

The use case is that I have a collection of items in a page of HTML,
and I'm using JQuery to build up a JavaScript model (and insert these
list items into Google Maps).

So, I'm selecting on a class and then iterating over all the items in
that class - and performing a find on each item.

The following example should illustrate the bug:

<div class="foo">
  <div class="bar">one</div>
</div>
<div class="foo">
  <div class="bar">two</div>
</div>
<div class="foo">
  <div class="bar">three</div>
</div>
<div class="foo">
  <div class="bar">four</div>
</div>

var text;
var foos = $('.foo');
foos.each(function(index, foo) {
    text = $(foo).find('.bar').text();
    console.log('text: ' + text);
});

In Safari and Firefox on Win and Mac, text is based only on the
descendants of the currently-selected .foo:

one
two
three
four

In IE 7, text is:

onetwothreefour
onetwothreefour
onetwothreefour
onetwothreefour

It seems as if the .find is not respecting the current selection that
it's hanging off of, and is instead traversing the entire document.
These queries are also extremely slow in IE as compared to the
alternatives.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to