0

I append some text to a container, and alert user after successful append like;

$("SomeTextToAppend").appendTo(".container",function(){
  alert("appended");
});

But alert is not working. Appending is fine. Also, I would like to know how to do the same using append() function. How can I do this?

4

1 回答 1

0

查看文档appendTo()不接受第二个论点。

您必须执行以下操作:

$("SomeTextToAppend").appendTo(".container");
alert("appended");

反过来做append()会看起来更像

$(".container").append("SomeTextToAppend");

希望这可以帮助

于 2013-08-24T17:16:03.097 回答