khex khex - 1 year ago 150
Javascript Question

Fetch meta-tags from url only by jQuery

Now a lot of scripts to facebook-style fetching data from url, but all of them work only in combination of jQuery and PHP. Is it possible to fetch url only by jQuery?

I have found here how to get mata-tags of page by:

$("meta[property=og:title]").attr("content", document.title);

But how correctly insert this query in jQuery.get() to get text values?

$.get('', function(data) {

And if the most popular sites use OpenGraph should I look in the direction of jQuery.getJSON()?

Answer Source

Use the html data retrieved from URL

function(data) {