有哪位能告訴我這是什么情況啊
不管輸什么,我的對話框里都是輸出的一段奇怪的代碼??
<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <% String?path?=?request.getContextPath(); String?basePath?=?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <html?xmlns="http://www.w3.org/1999/xhtml"> ?<head> ?<meta?http-equiv="Content-Type"?content="text/html;?charset=UTF-8"?/> ?<title>微信公眾號</title> ?<!--討論區滾動條begin--> ?<link?rel="stylesheet"?type="text/css"?href="<%=?basePath?%>resources/css/jscrollpane1.css"?/> ?<script?src="<%=?basePath?%>resources/js/common/jquery-1.8.0.min.js"?type="text/javascript"></script> ?<!--?the?mousewheel?plugin?--> ?<script?type="text/javascript"?src="<%=?basePath?%>resources/js/common/jquery.mousewheel.js"></script> ?<!--?the?jScrollPane?script?--> ?<script?type="text/javascript"?src="<%=?basePath?%>resources/js/common/jquery.jscrollpane.min.js"></script> ?<script?type="text/javascript"?src="<%=?basePath?%>resources/js/common/scroll-startstop.events.jquery.js"></script> ?<!--討論區滾動條end--> ?<script?type="text/javascript"?src="<%=?basePath%>resources/js/front/communicate.js"></script> ?</head> ?<body> ??<input?type="hidden"?value="<%=?basePath?%>"?id="basePath"/> ??<br/> ??<div?class="talk"> ???<div?class="talk_title"><span>正在與公眾號對話</span></div> ???<div?class="talk_record"> ????<div?id="jp-container"?class="jp-container"> ????? ????</div> ???</div> ??? ???<div?class="talk_word"> ???? ????<input?class="add_face"?id="facial"?type="button"?title="添加表情"?value=""?/> ????<input?id="content"?class="messages?emotion"???/> ????<input?class="talk_send"?onclick="send();"?type="button"?title="發送"?value="發送"?/> ???</div> ??</div> ??<div?style="text-align:center;margin:50px?0;?font:normal?14px/24px?'MicroSoft?YaHei';"></div> ?</body> </html>
JavaScript
send方法
/** ?*?send?message ?*?@returns ?*/ function?send(){ ?var?content?=?$("#content").val; ?if(!content){ ??alert("input?context."); ??return; ?} ?$.ajax({ ??url:$("#basePath").val()+"AutoReplyServlet.action", ??type:"POST", ??dataType:"text", ??timeout:1000, ??success:function(data){ ???appendDialog("talk_recordboxme","MyAccount",content); ???appendDialog("talk_recordbox","OfficialAccount",data); ???$("#content").val(""); ???render(); ??}, ??data:{"content":content} ?}); }
2017-03-18
但是還有一個問題就是,為什么我寫的明明是小寫,為什么輸出的全變成大寫了????
2017-03-18
好吧,我真傻真的,send里的var?content?=?$("#content").val;最后因該是val();