Skip to content Skip to sidebar Skip to footer

Failed To Execute 'postmessage' On 'domwindow' Using Google Code

I would like to add a Google+ badge on my site. When I copy/paste code from Google configuration tool, the badge does not work. I thought the problem might be in the JavaScript so

Solution 1:

The issue may be that the Google+ badge may require you to run the code through a web server instead of viewing it locally through the filesystem.

Instead of just opening the HTML file, try to host it using a web server. There are many options here. If you have Python installed, you could try running:

cd [directory where file is located]
python -m SimpleHTTPServer 8080

and then viewing it in a web browser at http://localhost:8080


The reason I think this may be the issue is that I also get errors when running it locally off the filesystem (though not the same errors as you), but when I view it through a web browser, it works fine, like so:

https://jsfiddle.net/wwkdgL5b/

Post a Comment for "Failed To Execute 'postmessage' On 'domwindow' Using Google Code"