【发布时间】:2010-08-19 11:12:56
【问题描述】:
如何使这段代码工作?我不知道如何从 $.get 回调中联系到 div。
$("<div/>", {
text: "some text",
click: function (e) {
$.get("bar.php", function(data) {
$(this).text(data); // doesn't work
});
}
}).appendTo("body");
【问题讨论】:
标签: javascript jquery scope