Ben Shelock
Ben Shelock

Reputation: 20985

jQuery Ajax - Returning [object Object]

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

This fetches the content fine however the alert just says

[object Object]

When I do alert(data); it shows the HTML of the page perfectly.

Upvotes: 3

Views: 21205

Answers (1)

Jochen Ritzel
Jochen Ritzel

Reputation: 107696

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

Upvotes: 8

Related Questions