Skip to main content

Bug Tracker

Side navigation

#1930 closed bug (worksforme)

Opened November 14, 2007 09:10PM UTC

Closed November 28, 2007 10:32PM UTC

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 (0.7 KB) - added by davidserduke November 28, 2007 10:34PM UTC.

    test case (best guess)

Change History (3)

Changed November 14, 2007 09:16PM UTC by shaupt comment:1

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 November 14, 2007 10:27PM UTC by davidserduke comment:2

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 November 28, 2007 10:32PM UTC by davidserduke comment:3

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.