Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
150
rated 0 times [  157] [ 7]  / answers: 1 / hits: 38654  / 10 Years ago, wed, may 21, 2014, 12:00:00

I'm using FB.ui to share a page to Facebook and I'm trying to set the title and message (image if possible but not important). I have this in my site header



<meta property=og:title content=Your title here />
<meta property=og:description content=your description here />


And my javascript code is



FB.ui({
method: 'share',
href: document.URL,
}, function(response){

//TODO Proper response handling
log(response);
if (typeof response != 'undefined') {
alert('Thanks for sharing');
}
});


From what I've read I just need to og:titleand og:description to set the title and message, but that doesn't seem to work.



Current the title is either coming from part of the part title, or an alt tag on an image, and the message is being populated from just a random paragraph tag.


More From » facebook

 Answers
18

The meta data might be cached by Facebook. Try entering your url in the Facebook debugger: https://developers.facebook.com/tools/debug/



This will clear the cache.



For image use this:



<meta property=og:image content=http://yourimage>


Facebook recommends using images with a min size of 1200x630 pixels


[#70918] Monday, May 19, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
miranda

Total Points: 655
Total Questions: 110
Total Answers: 121

Location: Netherlands
Member since Thu, Jul 1, 2021
3 Years ago
miranda questions
Sun, Jun 6, 21, 00:00, 3 Years ago
Tue, Mar 16, 21, 00:00, 3 Years ago
Sun, Feb 7, 21, 00:00, 3 Years ago
Mon, Jan 18, 21, 00:00, 3 Years ago
Fri, Jul 17, 20, 00:00, 4 Years ago
;