首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

踩顶效能ajax

2012-09-02 
踩顶功能ajax??//投赞成票function doContentVote(siteId,contentId) {var url cp+/jsp/portal/opconte

踩顶功能ajax

?

?

//投赞成票function doContentVote(siteId,contentId) {    var url = cp+"/jsp/portal/opcontent/content_service.jsp?action=doVote&contentId="+contentId+"&siteId="+siteId;     if (window.XMLHttpRequest) {         req = new XMLHttpRequest();     }else if (window.ActiveXObject) {         req = new ActiveXObject("Microsoft.XMLHTTP");     } if(req){     req.open("POST", url, true);     req.onreadystatechange = callbackContentVote;     req.send(null);  } } //回调函数function callbackContentVote() {     if (req.readyState == 4) {         if (req.status == 200) {            var obj = eval("("+req.responseText+")");            if(obj.flag==0) {            alert("您的投票次数已达上限!");            }else{alert("投票成功"+obj.voteCount);document.getElementById("voteCountId").innerHTML=obj.voteCount;                     }        }else{         alert ("投赞成票出错:" + req.statusText);         }            } } 

?

java

JSONObject obj = JSONObject.fromObject(retMap);out.print(obj.toString());
?

?

热点排行