Below script will downlaod the facebook sdk to generate the code to create the like button
(function() {
var scrFaceBook = document.createElement('script');
scrFaceBook.type = 'text/javascript';
scrFaceBook.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
scrFaceBook.async = true;
document.getElementById('fb-root').appendChild(scrFaceBook);
})();
<div class="fb-like" data-send="false" data-width="450" data-show-faces="true" data-font="arial"></div>
I am doing like this to add the FaceBook like button. When I run my application and see I get “object does not support this property or method, all.js, uri: https://connect.facebook.net/en_US/all.js“
Can some one suggest me how do I fix this? Thanks in advance.
You forgot to add the
<div id="fb-root"></div>to the body of the HTML.Also you seem to have forgotten the APP ID