jQuery Ajax 只加载某个div?
您好,有人可以帮助我如何在第一个示例中指定我只想处理某个 DIV,就像我可以使用“load”方法而不是“ajax”长版本那样? 谢谢
// WITH EXTENDED VERSION, how to specify a div to be processed?
$.ajax({
url: 'ajax/test.html',
success: function(data) {
$('#current-div').html(data);
alert('Load was performed.');
}
});
// WITH LOAD, it's ok|
$("a").click(function() {
var myUrl = $(this).attr("href") + " #external-div";
$("#current-div").load(myUrl);
return false;
});
Hi can someone help me how to specify in the first example that i want processing only a certian DIV like i can do with the "load" method insteasd of "ajax" long version?
thank you
// WITH EXTENDED VERSION, how to specify a div to be processed?
$.ajax({
url: 'ajax/test.html',
success: function(data) {
$('#current-div').html(data);
alert('Load was performed.');
}
});
// WITH LOAD, it's ok|
$("a").click(function() {
var myUrl = $(this).attr("href") + " #external-div";
$("#current-div").load(myUrl);
return false;
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想你所追求的就是这个?
I think that what you're after is this?