Opened 14 years ago
Closed 13 years ago
#4761 closed bug (duplicate)
hasClass() can't parse classes with newlines.
Reported by: | docwhat | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
hasClass() doesn't properly parse classes with newlines.
Here's a simple page to reproduce it.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html><body> <div id="div1" class="one two">buggy?</div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script> <script type="text/javascript"> $(document).ready(function () { var el = $('div#div1'); if (el.hasClass('one')) { el.text('No bug! Yay!'); } else { el.text('The bug is present. Boo.'); } }); </script> </body></html>
Attachments (1)
Change History (4)
comment:1 Changed 14 years ago by
Changed 14 years ago by
Attachment: | jquery-1.3.2.js.diff added |
---|
Patch, replacing line breaks with spaces
comment:3 Changed 13 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Dup of #5505, which has a better patch. (This one requires \r\n in sequence.)
Note: See
TracTickets for help on using
tickets.
This happens on IE only.