I want to request something with AJAX (no problem), I’ll get plain html back which looks like this
<div> abc </div>
<div> def </div>
now I want to do $.each through the html elements received in the success part of AJAX.
$(document).ready(function () {
$("#someButton").click(function () {
$.ajax({
url: '/Cens/ored',
dataType: 'html',
success: function (data) {
}
});
});
});
How can I do this?
well that depends, if you need to append only the plain html in some part of your dome you could do something like this
Now, if you need to attach each div that you’re receiving in different’s parts of the Dom, you should take use the each function like this, note’s that is just a example