当前位置: 代码迷 >> JavaScript >> 点击按钮GET方式发送到指定的文件,该怎么解决
  详细解决方案

点击按钮GET方式发送到指定的文件,该怎么解决

热度:136   发布时间:2012-04-26 14:01:31.0
点击按钮GET方式发送到指定的文件
function onexplode() 

if(confirm("要导出EXCEL吗?"))
{
document.form1.action.value="daochu.php";
document.form1.method.value="GET";
document.form1.submit();
}


我这样发不过去,而且页面变量也传不过去

------解决方案--------------------
<title>无标题文档</title>
<script type="text/javascript">
function change(){
var a=document.forms[0];
a.action="http://www.baidu.com/s";
a.method="get";
a.submit();
}
</script>
</head>

<body>
<form action="" method="post">
<input type="text" name="wd">
<input type="button" id="test" onclick="change()">
</form>
</body>
</html>
  相关解决方案