I set parameters such as picture and name but it not displaying name of the pet and other information below is given a preview of sharing. why both previews are different and why not displaying some data please help me how can I resolve this error and thanks in advance.
Link - 1
Link - 2
The best way is Instead of passing link directly in href
tag Use some custom facebook developer jquery to share your post or page with the image.
For example, your a
tag is like
<a id="fb_id" class="facebook" href="javascript:void(0);"><i class="fa fa-facebook" aria-hidden="true"></i></a>
and then you may use custom developer script like following,
window.fbAsyncInit = function() {
FB.init({
appId : IP, // ADD YOUR appID
xfbml : true,
version : 'v2.5'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
window.onload = function(){
document.getElementById('fb_id').onclick = function() {
FB.ui({
method: 'share', // YOU MAY SET YOUR METHOD HERE feed OR share
href: DOMAIN, // ADD YOUR DOMAIN NAME HERE WHICH YOU HAVE ADDED WHILE CREATING NEW APP.
}, function(response){});
};
};
It will sure display data with an image while sharing your page.
NOTE: IT MAY BE NOT WORK IN YOUR LOCAL ENVIRONMENT.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.