怎样在javascript,比如填写表单后得到结果,但还想重新再次输入内容,想返回输入页面,注意::输入页面和结果显示页面在同一页面,怎样做?
解决方案 »
- 关于jquery的thickbox插件
- javascript错误:5007
- 这段有什么问题
- 求助,卡住了,请问有人知道什么是匿名函数嘛?下面这段是吗?是的话怎么应用啊?
- 当checkbox的内容为一项时,alert(checkbox.length)竟是undefined???
- 如何在<textarea>特定位置中插入特定字符?
- 如何控制只能引用本地图片或网上图片其中之一?
- 怎么样实现图片不在ie里面显示,而直接下载??
- ie5和ie5.5里的showModalDialog默认值是不是不同?
- react import 传过来的函数接受不到参数是什么情况?
- JS在IE下无效了,怎么办?
- JavaScript
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script language="javascript" type="text/javascript">
function preview(){
var zhanghao=document.form1.zhanghao.value;
var author=document.form1.author.value;
var note=document.form1.note.value;
var tel=document.form1.tel.value;
var pTag = document.createElement("div");
pTag.innerHTML=" <table width='500' border='0' cellspacing='1' cellpadding='4' align='center'>"+" <tr> <td class='zhanghao' >"+zhanghao+" <hr> </td> </tr>"+" <tr> <td >作者:"+author+" </td> </tr>"+" <tr> <td class='news'>"+note+" </td> </tr>"+" <tr> <td class='news'>"+tel+" </td> </tr>"+" </table>"+" <p align='center'> <button onclick='document.form1.submit();'>提交 </button>";
document.body.appendChild(pTag)
}
</script>
</head>
<body>
<form action="b.php" method="post" name="form1">
<input type="text" name="zhanghao" >
<input type="text" name="author" >
<input type="text" name="note" >
<input type="text" name="tel" >
<input type="button" value="tijiao" onclick="javascript:preview();">
</form>
</body>
</html>
AJAX这么普遍,为什么不用?AJAX提交页面不刷新。
要不你就弹出个div,在div内输入东西,反显到父页面,然后关闭弹出层