Need to snag page title and other meta from jQuery's $.get results. Read somewhere on here (can't seem to find the question though - sorry!) that it only returns elements within body. That said, if I log the results to the console I see a massive array of data that includes the title and meta tags.
So the question is simple- how can I navigate the array to pull out the title?
Here's an example. The below example returns content as an HTML object, but title returns undefined. Makes sense if only the body is returned. That said, logging data prints the entire pages HTML from top to bottom. Logging thiis prints the page as an array, where I can see an entry for title, whose innerHTML has the page title. So -
how should title's value be assigned?
Thanks for your help!
JavaScript
$.get(target, function(data){
var thiis = $(data),
content = thiis.find('#pageMain'),
title = thiis.find('title');
console.log(data, thiis);
});