请问如何点按钮后阻止跳到下一页?详情请进! <input type="button" name="hh" value="ok" onclick="aa();">~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼上的方法可以实现了还可以有另一种:<form method="post" action="a.html" name="a" onsubmit="aa();return false;"><input type="submit" name="hh" value="ok" ><script>function aa(){window.location="b.html";}</script></form>你还可以在aa()方法里面对表单进行一些校验 还有一种方法:<form method="post" action="a.html" name="a"><input type="button" name="hh" value="ok" onclick="aa()"><script>function aa(){ window.document.a.action="b.html" ;//这里加上你的校验代码(如果需要的话) a.submit(); }</script>这样作的好处是:数据传递方式是post,在地址栏理看不到你传的参数。</form> js如何复制某行tr,然后重载添加该行呢 如何用JS实现地址栏地址改写,但页面不能跳转 javascript和jscript有什么差别阿。 怎么让图片加载完后再执行JS 为何input text控件会被锁定无法输入 iframe选中区域问题 页面跳转用request.getHeard('referer')接收的问题! "ForReading" 未定义的错误? 在iframe中调用window.open后的问题 這個問題有點難啊,高手菜鳥都可來看的.嘻嘻 javascript能获得客户端某个指定目录的子目录结构吗? 请问如何点按钮后阻止跳到下一页?详情请进!谢谢
还可以有另一种:
<form method="post" action="a.html" name="a" onsubmit="aa();return false;">
<input type="submit" name="hh" value="ok" >
<script>
function aa(){window.location="b.html";}
</script>
</form>你还可以在aa()方法里面对表单进行一些校验
<form method="post" action="a.html" name="a">
<input type="button" name="hh" value="ok" onclick="aa()">
<script>
function aa(){
window.document.a.action="b.html" ;
//这里加上你的校验代码(如果需要的话) a.submit();
}
</script>这样作的好处是:数据传递方式是post,在地址栏理看不到你传的参数。
</form>