i copied your code to my site and nothing happens... i copied and pasted so didn't change anything.. I don't have a web address just trying it on local web..
What did you name the pages?
Note the second page name is hard coded in the JavaScript as 'poll_vote_ajax_asp_dovote.asp
If you named it something else and did not change the script in the first page, then you'll get a 404 error and never return anything.
For debugging use this function in place of the former, and add a division in the HTML.
function handleHttpResponse(pObjRequest, pElementId) {
if (pObjRequest.readyState==4) {
if (pObjRequest.status==200) {
document.getElementById('voteform').style.display='none';
document.getElementById('waiting').style.display='none';
document.getElementById('results').style.display='inline';
var votes = pObjRequest.responseText.split(',');
var tmp = votes[0].split('=');
var yeses = parseInt(tmp[1]);
tmp = votes[1].split('=');
var nos = parseInt(tmp[1]);
var yp = Math.round((yeses / (yeses + nos)) * 100);
var yn = Math.round((nos / (yeses + nos)) * 100);
var barchart = '<span>Do people Like broccoli</span><br>';
barchart += '<div class="votes"><div class="chart"><img border="0" src="images/1x15navy.gif" width="'+yp+'" height="15"></div>Yes: '+yp+'%</div>';
barchart += '<div class="votes"><div class="chart"><img border="0" src="images/1x15navy.gif" width="'+yn+'" height="15"></div>No: '+yn+'%</div>';
document.getElementById(pElementId).innerHTML=barchart;
pObjRequest=null;
}else{
document.getElementById('statuslog').innerHTML += 'Status: '+pObjRequest.status+'<br>';
}
}else{
document.getElementById('statuslog').innerHTML += 'Ready State: '+pObjRequest.readyState+'<br>';
}
}
And in the HTML
<div id="statuslog">Ajax Status:<br></div>
Which will show you what is going on with the response object. If and when it fails it will be easy to determine why.
And of course, all of this assumes your local web is capable of running an ASP page. e.g.
<%
response.write("ASP Works")
%>
Saved in a page all by it self called test.asp works correctly.