window.οnlοad=function(){
var oForm=document.getElementById("fore");
var oButton=document.getElementById("bun");
var oL_content=document.getElementById("L_content");
var oHid=document.getElementById("hid");
var oJieda=document.getElementById("jieda");
oButton.οnclick=function(){
var request=new XMLHttpRequest();
request.open('post','${pageContext.request.contextPath}/ReplyArticle.do',true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.send('content='+oL_content.innerHTML+'&artidorcommid='+oHid.value);
request.οnlοad=function(){
var json={
name:'${login_user.nickname}',
head_URI:'${login_user.nickname}',
date:new date,
content:oL_content.innerHTML,
goodnum:0
}
var html=template('cont',json);
oJieda.appendChild(oL);
oL.innerHTML=html;
}
}
}
</script>
<div class="layui-form layui-form-pane">
<form action="ReplyArticle.do" method="post" id="fore">
<div class="layui-form-item layui-form-text">
<div class="layui-input-block">
<textarea id="L_content" name="content" required lay-verify="required" placeholder="我要回答" class="layui-textarea fly-editor" style="height: 150px;"></textarea>
</div>
</div>
<div class="layui-form-item">
<input type="hidden" id="hid" value="${ artmap.id }">
<button class="layui-btn" id="bun" >提交回答</button>
</div>
</form>
</div>
AJAX中不能写成oL_content.innerHTML,改为oL_content.value