my question is very simple how can I retrieve certain div with jquery ajax comand
$.ajax({
url: "test.html",
success: function(){
$(this).addClass("done");
}
});
like with load
$('#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);
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With