js传参问题
onClick="k(<%=request.QueryString("fname")%>,<%=session("name2")%>,<%=request.QueryString("picno")%>);"老提示第一个参数未定义;k()为
function k(code,name,picno)
{ alert("");
var date = new Date(); //日期对象
var now = "";
now = date.getFullYear()+"-"; //读英文就行了
now = now + (date.getMonth()+1)+"-"; //取月的时候取的是当前月-1如果想取当前月+1就可以了
now = now + date.getDate()+" ";
now = now + date.getHours()+":";
now = now + date.getMinutes()+":";
now = now + date.getSeconds();
var headpic=$("#head").attr("src");
var comments=$("#COMMENTS").innerHTML;
var picture=$("#img1").attr("src");
if(document.getElementById("COMMENTS").value.length>500)
$("#hint").show().val("字符不能超过500个!");
else
if(ltrim(comments)=="")
$("#hint").show().val("请填写评论!");
else
if(comments!="")
{ $.get("xieru1.asp?code="+escape(code)+"&picno="+escape(picno)+"&comments="+escape(comments)+"&headpic="+escape(headpic)+"&picture="+escape(picture));
$("comments").append("<td><div><img src='+ headpic +' align='top' onload ='DrawImage1(this)'/></div><div><span style='font-size:14px;color:#666666'>" + name +"</span> <span style='font-size:12px;color:#666666'>"+ now + "</span><br><span style='font-size:14px;color:#333333'>"+ comments +"</span></div> </td>");
}
else
$("#hint").show().val("请填写评论!");
}