JQuery Ajax - Return [object object]

$.get($(this).attr('id'), function(data){
var qp_post = $(data).filter('title');
alert(qp_post);
});

This allows you to retrieve the content, but the warning just says

[object Object]

When I make a warning (data); It renders the HTML page perfectly.

+3
source share
1 answer

Yes, that’s how jquery works. Are you looking for alert( qp_post.html() );?

+8
source

Source: https://habr.com/ru/post/1717568/


All Articles