Opened 17 years ago
Closed 16 years ago
#1039 closed bug (fixed)
$(html) fails with html comment
Reported by: | arrix | Owned by: | davidserduke |
---|---|---|---|
Priority: | major | Milestone: | 1.2.2 |
Component: | core | Version: | 1.1.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
$('<!-- comment -->') -> [[undefined, undefined]] $('<div></div><!-- comment --><div></div>') -> [div, [undefined, undefined, undefined, 6 more...], div]
Although it seems absurd to pass in html comment when hand coding, sometimes the argument is generated from a design html page. So there are chances that the html string passed to $ contains comments.
Attachments (1)
Change History (6)
comment:1 Changed 17 years ago by
need: | → Test Case |
---|
comment:2 Changed 17 years ago by
need: | Test Case → Review |
---|
comment:3 Changed 16 years ago by
Description: | modified (diff) |
---|---|
Owner: | set to davidserduke |
Status: | new → assigned |
Is this a bad thing? From what I can tell it is a comment node and works fine when inserted. Then the question would be can jQuery handle it and might be a similar ticket to #1733 which discusses the problems with text nodes. the [undefined, undefined, undefined, 6 more...] part is just FireBugs representation of the node as an array because it has a length property and not a problem in itself that I can see.
I don't see a problem with leaving the comments in as long as jQuery is robust enough to handle it correctly.
comment:4 Changed 16 years ago by
Milestone: | 1.1.3 → 1.2.2 |
---|
comment:5 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in [4062] such that the comment node will be included if the browser allows it, but the rest of jQuery will not break having a comment node in the jQuery object.
What is the expected behaviour here?