//提交留言 function submitComment(){ if($("message").value=="请在此填写留言" || $("message").value==""){ alert("请填写留言"); $("commentSubmitButton").style.visibility = "visible" ; }else{ var myAjax = new Ajax.Request( '/comment/execComment.ashx', {method: 'post', parameters: {message:$("message").value,artSN:$("artSN").value,chkCode:$("chkCode").value,anony:$("anony").value,psn:$("psn").value}, onComplete: showResponse} ); } } //提交留言后的动作 function showResponse(data) { //alert(data.responseText); $("commentSubmitButton").style.visibility = "visible" ; if(data.responseText=="0"){ getCommentList(); alert("发表成功"); } if(data.responseText=="1"){ alert("验证码错误"); //getCommentList(); } if(data.responseText=="2"){ alert("未知错误"); //getCommentList(); } $("chkCodeImg").onclick(); $("message").value="请在此填写留言"; } //获得最后5条留言 function getCommentList() { var request_url = "/comment/listComment.ashx"; // 需要获取内容的url var myAjax = new Ajax.Updater('comment', request_url,{ // 将request_url返回内容绑定到id为result的容器中 method : 'get', //HTTP请求的方法,get or post parameters : {rnd:Math.random(),artSN:'200910094L0KIB'}, //请求参数 onFailure : reportError, //失败的时候调用 reportError 函数 onLoading : loading, //正在获得内容的时候 onComplete : done //内容获取完毕的时候 }); } function loading() { $('loading').style.display = 'block'; } function done() { $('loading').style.display = 'none'; } function reportError(request) { alert('有错误发生'); } //画出框架 var str='\
\
\
\
网友评论
\
[察看全部评论]
\
\
\
正在读取留言..
\
\
\
\
\ \
\
\
\
\ 匿名发表 \ \ \ 验证码 \  \
\
\
\
\ '; function check(obj) { if(obj.value=='') obj.value='请在此填写留言'; else if(obj.value=='请在此填写留言') obj.value=''; } document.write(str); function reload(obj,psn){ obj.src = 'http://passport.tiga.com.cn/checkCode.ashx?psn='+psn+'&rnd='+Math.random(); } function getCookie(sName) { var aCookie = document.cookie.split("; "); for (var i=0; i < aCookie.length; i++) { var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return unescape(aCrumb[1]); } return ""; } /* var winLogin = new Window("loginForm", {className: "alphacube",title: "数字鲸导游",top:2, left:2, width:200, height:200, zIndex:99999, opacity:1, resizable: false, minimizable: false, maximizable: false,closable:true}); var str2 = ''; str2 += '
'; str2 += '帐号
'; str2 += '密码
'; str2 += '验证码'; str2 += ''; str2 += '
'; str2 += ''; str2 += ''; str2 += '
'; winLogin.getContent().innerHTML = str2; //winLogin.setDestroyOnClose(); */ function isLoginUser(){ if(readcookie("uid")!=null && readcookie("uid")!=""){ return true; }else{ var winLogin = new Window("loginForm", {className: "alphacube",title: "数字鲸导游",top:2, left:2, width:200, height:200, zIndex:99999, opacity:1, resizable: false, minimizable: false, maximizable: false,closable:true}); var str2 = ''; str2 += '
'; str2 += '帐号
'; str2 += '密码
'; str2 += '验证码'; str2 += ''; str2 += '
'; str2 += ''; str2 += ''; str2 += '
'; winLogin.getContent().innerHTML = str2; winLogin.showCenter(true); winLogin.toFront(); return false; } } function submit(){ if($("anony").value==-1){ $("commentSubmitButton").style.visibility = "hidden"; submitComment(); }else{ if(isLoginUser()){ $("commentSubmitButton").style.visibility = "hidden"; submitComment(); } } } //获取留言 getCommentList();