I’ve got ajax working that returns whole HTML page.
I need to fetch a div tag which the class name is ‘thisclass’, this is a unique css class on that page.
I managed to use .find(), but then the string turned into object, how to solve this?
$.ajax({
'url': '/test/',
'type': 'POST',
'data': {'age': age},
'dataType': 'html',
'success': function(data) {
// data contains a whole page of HTML, I need the contents of a div tag
which has css class .thisclass
});
Try this code,