Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery Select meta[property=og:image]?

I want to select in Jquery the main photo in a web page, I just have the url page. so I decided to use the meta written for Facebook sharing.

I want to select the content of : meta property="og:image" content="http://blablabla.jpg"

I wrote this, but it doesn't work: $("meta[property=og:image]").attr("content");

Any ideas ? Thank you

like image 386
Maxxx Avatar asked Jan 23 '12 19:01

Maxxx


1 Answers

$('meta[property="og:image"]').attr('content')

http://jsfiddle.net/ZxmCw/

like image 200
AlienWebguy Avatar answered Sep 28 '22 08:09

AlienWebguy