function createXMLObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
isIE = true;
return new ActiveXObject("Microsoft.XMLHttp");
}
}
//**Review 保存js函数*******
//* savereview(ln,lp,rn,st,ss,rb)
//* Ln用户登录email 可以为””
//* Lp 拥护登录密码,可以为””
//* Rn 评论的资源名字(如:xxxx hotel,xxx photos)
//* St,评论的资源类型 (如:A(酒店), 7(景点),4(游船))
//* Ss 评论资源的sn 必须要长整型 (如: 1112, 2221) 不能为字符
//* Rb 评论的内容
//* 该函数返回字符串,返回”yes”为保存成功
//* 返回 “no”为用户名或密码错误。返回其他字符为保存数据错误。
//*****//
function savereview(ln,lp,rn,st,ss,rb){
ln = escape(ln);
lp = escape(lp);
rn = escape(rn);
st = escape(st);
ss = escape(ss);
rb = escape(rb);
geturl = "/community/review/savereview.asp?loginname="+ln+"&loginpwd="+lp+"&rname="+rn+"&ServiceType="+st+"&ServiceSN="+ss+"&rbody="+rb;
//document.writeln(geturl);
var xmlHttp = createXMLObject();
xmlHttp.open("POST", geturl, false);
xmlHttp.send(null);
return (xmlHttp.responseText);
}
//信息页面添加评论 2009-08-17 ycc
//MainID 信息ID
//MainName 资源名字
//MainType 资源类型
/// Last modified by IMT 08 30.
function SendCommentForInfo(MainID,MainName,MainType){
var CommentError=document.getElementById('CommentError'),CommentContent=document.getElementById('CommentContent'),CommentUserName=document.getElementById('CommentUserName'),CommentPassWord=document.getElementById('CommentPassWord'),ResultData,conEv,uName,uPass;
if(CommentContent) conEv = CommentContent.value;
if(CommentUserName)
{
uName = CommentUserName.value;
}
else
{
uName ='';
}
if(CommentPassWord)
{
uPass = CommentPassWord.value;
}
else
{
uPass ='';
}
ResultData=savereview(uName,uPass,MainName,MainType,MainID,conEv);
if (ResultData=='no') {
CommentError.innerHTML='Logon false!';
}else{
window.location.reload();
}
}
function ajaxsavereview(){
ln = document.getElementById("rloginname").value;
lp = document.getElementById("rloginpwd").value;
//la = document.getElementById("anys").value;
rb = document.getElementById("reviewbody").value;
rn = document.getElementById("r_name").value;
ss = document.getElementById("r_sn").value;
st = document.getElementById("r_type").value;
_tmpStr = savereview(ln,lp,rn,st,ss,rb);
_tmpStr =_tmpStr.replace(/(^\s*)|(\s*$)/g,"");
if (_tmpStr != "yes"){
alert("logon error");
$(".wirtePhotoAlbum h4").html("Wirte Your Review (logon error)");
}else{
window.location.reload();
}
}