innerhtml not working on blogger
Posted
by
HAnlin Cal
on Stack Overflow
See other posts from Stack Overflow
or by HAnlin Cal
Published on 2012-04-08T17:24:48Z
Indexed on
2012/04/08
17:29 UTC
Read the original article
Hit count: 194
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 the vote gets registered on the webhost, but the results just don't show!)
heres my code:
<script type="text/javascript">
function getVote(int)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("poll").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","http://pacontest.eu.pn/poll_vote.php?vote="+int,true);
xmlhttp.send();
}
</script>
<div id="poll">
<h3>Do you like this?</h3>
<form>
Yes:
<input type="radio" name="vote" value="0" onclick="getVote(this.value)" />
No:
<input type="radio" name="vote" value="1" onclick="getVote(this.value)" />
</form>
</div>
© Stack Overflow or respective owner