获取文件标题

I have a script which allows to retrieve meta content from any website: JsFiddle

I would like to retrieve the document title instead so I tried:

    $.each($foop.find("head[title]"), function(idx, item) {
        lnk = $(item).attr("title");
        $('<div>' + lnk + '</div>').appendTo($('#meta'));
    });

And:

    $.each($foop.find("document[title]"), function(idx, item) {
        lnk = $(item).attr("title");
        $('<div>' + lnk + '</div>').appendTo($('#meta'));
    });

And many more variations but nothing seems to work.

Use this in your callback :

var title = $foop.find('title').text();
console.log(title);

DEMO