我的问题很简单,如何使用jquery ajax comand检索某些div?
$.ajax({
url: "test.html",
success: function(){
$(this).addClass("done");
}
});
比如用负载?
$('#targetDiv').load('http://localhost/test.html #sourceDiv');
我的问题很简单,如何使用jquery ajax comand检索某些div?
$.ajax({
url: "test.html",
success: function(){
$(this).addClass("done");
}
});
比如用负载?
$('#targetDiv').load('http://localhost/test.html #sourceDiv');
If the div is part of the AJAX response:
$.ajax({
url: 'test.html',
dataType: 'html',
success: function(html) {
var div = $('#sourceDiv', $(html)).addClass('done');
$('#targetDiv').html(div);
}
});