Bug Tracker

Opened 13 years ago

Closed 13 years ago

#1930 closed bug (worksforme)

Traversing with parents() doesn't work in IE 7.0

Reported by: shaupt Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: IE, parents Cc:
Blocked by: Blocking:

Description

We use the following jquery expression: $('button').click( function() { alert( $(this).parents('[@class="csMyGroupStyle"]').size() ) } ); Clicking on the button in "Firefox 2.0" returns the value 1, but the "IE 7.0" returns the value 2. If we change the size() to html(), then Firefox returns the correct html code, but IE returns '<BUTTON STYLE="CURSOR:pointer; function (w){ var a = [], The array holding the partial texts. ...' It looks as in IE the method "parents()" is not interpreted correctly. It returns some function code back.

Attachments (1)

jquery_test.html (701 bytes) - added by davidserduke 13 years ago.
test case (best guess)

Download all attachments as: .zip

Change History (4)

comment:1 Changed 13 years ago by shaupt

We use the following jquery expression:

$('button').click( function() {
      alert( $(this).parents('[@class="csMyGroupStyle"]').size() );
   } ); 

Clicking on the button in "Firefox 2.0" returns the value 1, but the "IE 7.0" returns the value 2. If we change the size() to html(), then Firefox returns the correct html code, but IE returns

<BUTTON STYLE="CURSOR:pointer; function (w){
 var a = [], // The array holding the partial texts.
 ...

It looks as in IE the method "parents()" is not interpreted correctly.
It returns some function code back.

comment:2 Changed 13 years ago by davidserduke

It seems to work the same for me in IE7 and FF on the wiki http://docs.jquery.com/Traversing/parents#expr . Do you have an actual test case you could share?

comment:3 Changed 13 years ago by davidserduke

Resolution: worksforme
Status: newclosed

I created a test case based on the description and it works for me. If you have an alternate test case please reopen the bug and attach it.

Changed 13 years ago by davidserduke

Attachment: jquery_test.html added

test case (best guess)

Note: See TracTickets for help on using tickets.