【发布时间】:2013-03-23 17:19:38
【问题描述】:
当页面第一次加载时,我在 Jquery.ready 上加载的页面内容运行完美,然后当我使用 ajax 做一些事情并尝试再次加载页面时,javascript 在我尝试加载的第二个页面上不起作用.我尝试使用live() / on() 方法解决此问题,但没有成功。
$(document).ready(function () {
$("#grupyonetimarea").load("/Panel/MusteriSourcePages/mus_grup_add.aspx");
});
$('#btnekleme').live('click', function () {
$.ajax({
type: "POST",
url: "/Panel/MusteriSource/mus_kisiadd.aspx/mus_kisi_kaydet",
data: "{ad:'" + $.trim($("#txtalt_mus_adi").val()) + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
before: $("#btnekleme").hide(),
success: function (msg) {
if (msg.d == "ok") {
$("#grupyonetimarea").load("/Panel/MusteriSourcePages/mus_grup_add.aspx");
} else $("#loaded").html(msg.d).show(500);
},
error: function (x, e) {
alert("The call to the server side failed. " + x.responseText);
}
});
}
【问题讨论】:
标签: jquery jquery-load