您好,欢迎访问一九零五行业门户网

php和Ajax 投票系统_PHP教程

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
其它类似信息

推荐信息