Opened 13 years ago
Closed 12 years ago
#5316 closed bug (fixed)
replaceAll only the first element from the matched set replaces the selector set
Reported by: | TUSHKA | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.4.3 |
Component: | manipulation | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
var jq = $("<selector1>") selects more than one element jq.replaceAll("<selector2>")
only the first matched element from jq will show up as the replacement for "<selector2>"
Possible Fix: See Attachment
Attachments (2)
Change History (5)
Changed 13 years ago by
Attachment: | jquery.txt added |
---|
comment:1 Changed 13 years ago by
Possible fix, invoke replaceWith using call rather than apply. This will affect appendTo/append, prependTo/prepend, insertBefore/before, insertAfter/after as well, but it seems like those will work regardless of whether they are invoked via call or apply
comment:2 Changed 13 years ago by
Hello,
My workaround until fixed jq.wrap('<div/>').parent().replaceAll("<selector2>").replaceWith(jq)
Changed 13 years ago by
Attachment: | jquery-replaceall-testcase.html added |
---|
A test case to show the issue, run it in a browser to see what's happening.
comment:3 Changed 12 years ago by
Component: | core → manipulation |
---|---|
Milestone: | 1.4 → 1.4.3 |
Priority: | minor → high |
Resolution: | → fixed |
Status: | new → closed |
Version: | 1.3.2 → 1.4.2 |
test case fixed for 1.4.3
Possible Fix