高手请进,怎么用javascript来获得页面跳转事件(并且,如果在本页面post的话,不跳转)? 就是:地址栏中,有一系列的网站地址,我选择了其中一个后,页面就alert。或者自己手动输入一个网站地址,按了回车后,页面也alert但是:自己submit自己,页面不能alert 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><meta name="GENERATOR" content="Microsoft FrontPage 5.0"><meta name="ProgId" content="FrontPage.Editor.Document"><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>new</title>onbeforeunload<SCRIPT LANGUAGE="JavaScript" for=window Event=onbeforeunload><!--if(document.referrer!=null){ alert("abc"); }//--></SCRIPT><script>function bb(){ document.FM.submit();}</script></head><body ><form method="POST" action="" name =FM onsubmit=" bb()" ><input type="submit" value="button" name="B3"></p></form></body></html> <html><head><meta name="GENERATOR" content="Microsoft FrontPage 5.0"><meta name="ProgId" content="FrontPage.Editor.Document"><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>new</title><script>function aa(){ alert("aaa");}function bb(){ document.body.onunload="";//把事件取消 document.FM.submit();}</script></head><body onunload="aa()"><form method="POST" action="" name=FM><input type="button" value="button" name="B3" onclick="bb()"></p></form></body></html> 页面提交时带一个参数,如果有这个参数就不alert fandiy(龙霄溪舞) 的方法看起来貌似不错哦 look-------------------------------------------------------------------<html><head><meta name="GENERATOR" content="Microsoft FrontPage 6.0"><meta name="ProgId" content="FrontPage.Editor.Document"><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>new</title><script>var thisPage=false;function aa(){ alert("abc")}function bb(){thisPage=true; document.FM.submit();}window.onbeforeunload=function(){ if(!thisPage)alert("abc");}</script></head><body><form method="POST" action="" name = FM><input type="button" value="button" name="B3" onclick="bb()"></p></form></body></html> 新手写js又出错了- - 如何获取某个标签里的所有子元素? mysql client中输出表格无法对齐如何解决? 如何用Javascript获取html页面中的链接地址 点击背景变色 javascript select的 值填入 text 又是JS问题,烦,希望大家帮个忙! 要学HTC,有人搞过吗?推荐些资料吧 一个画饼图的程序 怎么判断在一个字符串内,一个字符串出现了好多次? 求例如CSDN首页中一帧一帧变化的那个制作的方法! 怎么控制动态插入的新行的格式
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>new</title>onbeforeunload<SCRIPT LANGUAGE="JavaScript" for=window Event=onbeforeunload>
<!--
if(document.referrer!=null){
alert("abc");
}
//-->
</SCRIPT><script>
function bb(){
document.FM.submit();
}
</script>
</head><body ><form method="POST" action="" name =FM onsubmit=" bb()" >
<input type="submit" value="button" name="B3"></p>
</form></body></html>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>new</title>
<script>
function aa(){
alert("aaa");
}function bb(){
document.body.onunload="";//把事件取消
document.FM.submit();
}
</script>
</head><body onunload="aa()"><form method="POST" action="" name=FM>
<input type="button" value="button" name="B3" onclick="bb()"></p>
</form></body></html>
的方法看起来貌似不错哦
-------------------------------------------------------------------
<html><head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>new</title>
<script>
var thisPage=false;function aa(){
alert("abc")
}function bb(){
thisPage=true;
document.FM.submit();
}window.onbeforeunload=function(){
if(!thisPage)alert("abc");
}
</script>
</head><body><form method="POST" action="" name = FM><input type="button" value="button" name="B3" onclick="bb()"></p>
</form></body></html>