参照 http://blog.csdn.net/chengbd/article/details/6887357 写了一个自己的版本
<div class="tabCont" >
<div class="topDiv" style="border:none">
<form id="mgsForm" action="person-msg-mode!getMsgMode.action" method="post" enctype="multipart/form-data" target="hidden_frame" οnsubmit="return VerifyMsg();">
UID :<input type="text" class="_txt" name="uc_sug_id" id="uc_sug_id" maxlength="60"/><br/>
标题:<input type="text" name="uc_sug_textfield" id="uc_sug_textfield" maxlength="18" class="_txt" /><br/>
图片: <input id="filell" title="图片请不要超过1M" name="filell" type="file" accept="image/*" hideFocus="true"/><br/>
内容:<textarea class="_area" name="uc_sug_textarea" id="uc_sug_textarea" maxlength="1000"></textarea>
<span class="op">您还可以输入<span class="red">1000</span>字<br/><button class="btn">发送</button></span>
</form>
<iframe name='hidden_frame' id="hidden_frame" style='display:none'></iframe>
</div>
<div class="adv">
<img src="./theme/imgs/ad01.jpg"/>
</div>
</div>
后台代码
处理完结果,还回数据
PrintWriter out = response.getWriter();
out.println("<script language='javascript'>");
out.print("parent.callback(1);"); //可以输入满足条件的值
out.println("</script>");
处理还回结果
function callbackabc(msg){
$("#uc_sug_textfield").val("");
$("#uc_sug_textarea").val("");
$("#uc_sug_id").val("");
var file = $("#filell");
file.after(file.clone().val(""));
file.remove(); //清空上传上传的文件
}