Skip to content Skip to sidebar Skip to footer

Innerhtml Not Working On Blogger

I'm working on a simple vote system. It works fine when the two files are together(locally). However, when I publish it on blogger, it is unable to output the results. (on click th

Solution 1:

It's not innerHTML that's not working. It's your call to an external site. You can't use XMLHttpRequest to get a resource from outside your domain: it's called a cross-domain restriction and is built into browser specifications.

It works when the PHP is hosted on the same domain as the code which GETs it, because that's not cross-domain.

You can get round the restriction by using a proxy script on your domain: the page requests the result from that server-side script and that script gets the result from the true location, returning that result to the browser.

That's not likely to be an option for Blogger, so Blogger provide their own poll widget.

Post a Comment for "Innerhtml Not Working On Blogger"