poll:
yes:
width=''
height='20'>
%
no:
width=''
height='20'>
%
//poll.js
var xmlhttp
function getxmlhttpobject(){
var object=null;
if (window.xmlhttprequest)
{
object=new xmlhttprequest()
}
else if (window.activexobject)
{
object=new activexobject(microsoft.xmlhttp)
}
return object;
}
function statechang(){
if(xmlhttp.readystate==4 || xmlhttp.readystate==complete){
document.getelementbyid(poll).
innerhtml=xmlhttp.responsetext;
}
}
function getvote(int){
xmlhttp=getxmlhttpobject()
if(xmlhttp==null){
alert('错误!');
return
}
var url=poll.php
url=url+?vote=+int
url=url+&sid=+math.random()
xmlhttp.onreadystatechange= statechang
xmlhttp.open(get,url,true)
xmlhttp.send(null)
}
//poll.html