Bug Tracker

Ticket #1930 (closed bug: worksforme)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: shaupt Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.2 Component: core
Version: 1.2.1 Keywords: IE, parents
Cc: Needs: Review

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

jquery_test.html (0.7 kB) - added by davidserduke 2 years ago.
test case (best guess)

Change History

Changed 2 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.

Changed 2 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?

Changed 2 years ago by davidserduke

  • status changed from new to closed
  • resolution set to worksforme

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 2 years ago by davidserduke

test case (best guess)

Note: See TracTickets for help on using tickets.