Bug Tracker

Modify

Ticket #6423 (closed bug: wontfix)

Opened 3 years ago

Last modified 23 months ago

"before()" works incorrectly with "clone()" in FF

Reported by: xitianfz Owned by:
Priority: low Milestone: 1.next
Component: manipulation Version: 1.4.2
Keywords: before clone FF Cc: timmywil
Blocking: Blocked by:

Description

alert($('<p>aaa</p>').clone().before('<a>bbb</a>').attr('nodeName')); alert($('<p>aaa</p>').clone().after('<a>bbb</a>').attr('nodeName')); These code will print "P" and "P" in IE, while it will be "A" and "P" in FF.

Change History

comment:1 Changed 3 years ago by addyosmani

  • need changed from Review to Patch
  • Priority set to low

Test case:  http://jsfiddle.net/fA4tC/

FF 3.6.10: A, P Chrome 6.04: A, P IE 9.0: P, P IE 6.0: P, P Safari 5.02: A,P

It would appear that IE is the only browser outputting P,P for this at the moment. As there are workarounds for this type of behaviour, I'm flagging as a low priority bug requiring a review and patch.

comment:2 Changed 3 years ago by addyosmani

  • Status changed from new to open

comment:3 Changed 3 years ago by addyosmani

  • Keywords FF added
  • Milestone changed from 1.4.3 to 1.4.4

comment:4 Changed 3 years ago by snover

  • Milestone changed from 1.4.4 to 1.4.5

Retargeting due to severity of regressions in 1.4.3.

comment:5 Changed 23 months ago by addyosmani

  • Cc timmywil added

Hmm. The behaviour for this ticket appears to have changed from returning unexpected values to returning 'undefined' for both cases with FF5 and the latest jQuery (edge).  http://jsfiddle.net/fA4tC/2/

comment:6 Changed 23 months ago by ajpiano

  • Status changed from open to closed
  • Resolution set to wontfix

nodeName is a property, so in jQuery 1.6 and greater, it should be accessed using the .prop() method.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.