I am trying to add a facebook button as a button to an ASP.NET page. I created the code with Get Like Button Code Widget and copied it to my main page. This button works fine in most cases, but for some random pages it is not. I checked javascript errors using the javascript console for developer tools in Chrome, but it doesn't seem to exist (I get the same problem in FF and IE).
Even stranger, I can find the url like mysite.com/category/12345/some-descriptive-name and see the problem. But drop a couple of letters from the end of the URL (e.g. mysite.com/category/12345/some-descriptive-na) and the problem goes away. [I use URL redirection as long as the id is the same, the same page goes up].
My best idea was that I hit some maximum length of the url, but that doesn't seem to be a problem, since just changing the Id in the url above works the same as expected.
I tried both HTML5 and XBFML versions of a similar button, both with the same problem.
The only thing I could think of was to create an application in the hope that this would make it more reliable.
Currently, I canβt tell you a public site, but the code below:
... <body class="clearfix"> <div id="fb-root"></div> <script>(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_GB/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> ... <div class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false" data-font="segoe ui"></div>
source share