Google +1 button javascript error not working on IE
Hi Guys,
I had the bad experience today of receiving a call from my client saying the website was not working properly due to javascript errors on IE7 and IE 8. I jumped on my IE and started to debug the Javascript console.
The little Story of how I found out and how I fixed it (skip this if in rush)
I could see an error making my jquery unusable. I thought about all the changes I made since yesterday and as a matter of chance (not really lol), I changed few things in the Google Analytics Tracking Code. So here I am debugging the google analytics code, reverting the old code etc etc. Bad luck, errors are still showing up and challenging me. I could see the code was coming from google and then tadaaaaa I thought about Google +1, removed the call to their js library and voila!
The issue in more details
I had the following issues:
No relay set (used as window.postMessage targetOrigin), cannot send cross-domain message
Object doesn’t support this property or method ‘K’
This error was making my jquery fail and I found other guys having the same issue with mootools. So no matter which JS framework you are using, this could cause severe troubles to your website on IE.
This issue was occuring on IE8 and IE7. Everything was working fine yesterday (the 25th October 2011), I suspect Google of having released something in the file you call below (or they simply don’t care about IE):
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
My advice
Remove it for now! Hope it helps and thank you Google for making my day a nightmare
!
I have to say this Google +1 button really challenged me since I integrated it on my client’s website. When you make something like a share button, you work on the accessibility and the usability. But I guess Google is Google, so they can say whatever!
Tags: google +1, javascript error
Trackback from your site.