Skip to content

Commit 0323f89

Browse files
mgoyetpranavkm
mgoyet
authored andcommitted
Use of jQuery append/prepend functions instead of DOM manipulation functions in asyncOnSuccess function (mode "BEFORE" or "AFTER")
https://aspnetwebstack.codeplex.com/workitem/2247
1 parent be30844 commit 0323f89

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/System.Web.Mvc/JavaScript/jquery.unobtrusive-ajax.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,10 @@
4646

4747
switch (mode) {
4848
case "BEFORE":
49-
top = update.firstChild;
50-
$("<div />").html(data).contents().each(function () {
51-
update.insertBefore(this, top);
52-
});
49+
$(update).prepend(data);
5350
break;
5451
case "AFTER":
55-
$("<div />").html(data).contents().each(function () {
56-
update.appendChild(this);
57-
});
52+
$(update).append(data);
5853
break;
5954
case "REPLACE-WITH":
6055
$(update).replaceWith(data);

0 commit comments

Comments
 (0)