?
?
//投赞成票 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());?
?