Facebook JavaScript SDK sometimes works other times not -
I am using this code on my website like Facebook:
$ ( Document) .ready (function () {var fbBtnLike = '(function (d, s, id) {var js, fjs = d.getElementsByTagName (s) [0]; if (d.getElementById (id)) returns; js = D .createElement (s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&id=124380934395811&version=v2.0".fjs.parentNode InsertBefore (js, fjs);} (document, 'script \', 'facebook-jssdk \')); var openFollow = function () {if (loadedSocial == 0) {eval (titterBtn + fbBtnLike + GooglePlusBtn ); LoadedSocial = 1;}}; $ ('# openFollow') hover (function () {openFollow ();});});
The strange thing is that I am not getting any error.
In addition to this it works a number of times that it does not work. It's very random.
Any thoughts?
Put it in a jquery ready function.
$ (document) .ready (function () {var fbBtnLike = '(function (d, s, id) {var js, fjs = d.getElementsByTagName (s) [0]; If (d.getElementById (id)) returns; JS = D. Socket element (s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1& AppId = 124380 9 34395811 and version = v2.0 "; fjs.parentNode.insertBefore (JS, FJS);} (document, 'script' ',' facebook-jssdk \ '));' open open 'function () {If (loadedSocial == 0) {eval (titterBtn + fbBtnLike + googlePlusBtn); loadedSocial = 1;}}; $ ('# openFollow') hover (function () {openFollow ();});});
Comments
Post a Comment