Am trying to build a facebook share button, but I keep getting an error message inside the share popup screen when I click the button
Could not resolve object at URL http://localhost:8080/App/templates/property-template.xhtml?propertyId=1#
I tried to use encodeURI
and encodeURIComponent
but got same result.
am using jsf with javascript to accomplish this.
JSF
<a href="#" class="btn btn-sm btn-round btn-o btn-facebook"
onclick="share(window.location.href);"><span class="fa fa-facebook"></span> Facebook</a>
javascript
function share(url) {
console.log(url);
FB.ui({
method : 'share',
href : url,
}, function(response) {
if (response && !response.error_code) {
alert('Posting completed.');
} else {
alert('Error while posting.');
}
});
}
Aucun commentaire:
Enregistrer un commentaire