我有这样的代码:
HTML:
<a href='#' id='link1'>Link 1</a>
<div id='content'></div>
Jquery脚本:
$("a#link1").live("click", function (e) {
e.preventDefault();
$.ajax({
data: ...,
type: "post",
url: ...,
async: true,
context: this,
success: function (result1) {
if (result1 == "ok") {
$.ajax({
data: ...,
type: "post",
url: ...,
async: true,
context: this,
success: function (result2) {
$(this).next("#content").append(result2);
}
});
}
}
});
});
我的问题:
- 当我单击 a#link1 时,内容(result2)附加到 div#content 但它不会立即显示,它只会在我刷新(F5)页面时显示。请帮我让它立即显示!