jsのページ更新とページジャンプの方法まとめ

13475 ワード

.js cookie        2009-12-15
js               
    :Web      : javascript 
js                
1.history.go(-1),       : history.go(-2); 

2. history.back(). 

3. window.history.forward()      

4. window.history.go(     ,         URL) 

 : 
<a href="javascript:history.go(-1);">    </a> 

response.Write("<script language=javascript>") 
response.Write("if(!confirm('    ?')){history.back();}") 
response.Write("</script>") 
response.Write("<script language=javascript>history.go(-1);</script>") 
<a href="javascript:history.go(-1);">    </a> 

    :onclick="window.location.href='list.aspx'" 

P.S. 
   (JS  JS): 
<script type=text/javascript> 
<!-- 
if (typeof SWFObject == "undefined") { 
document.write('<scr' + 'ipt type="text/javascript" src="/scripts/swfobject-1.5.js"></scr' + 'ipt>');} 
//--> 
</script> 

Javascript         : 
1    history.go(0) 
2    location.reload() 
3    location=location 
4    location.assign(location) 
5    document.execCommand('Refresh') 
6    window.navigate(location) 
7    location.replace(location) 
8    document.URL=location.href 

         : 
1.      :       <head>    
<meta http-equiv="refresh" content="20"> 
  20   20       . 

2.      :       <head>    
<meta http-equiv="refresh" content="20;url=http://www.wyxg.com"> 
  20  20     http://www.wyxg.com   

3.      js  
<script language="JavaScript"> 
function myrefresh() 
{ 
       window.location.reload(); 
} 
setTimeout('myrefresh()',1000); //  1      
</script> 

ASP.NET              
1.   this.response.write("<script>opener.location.reload();</script>"); 

2.   this.response.write("<script>opener.window.location.href = opener.window.location.href;</script>"); 


3.   Response.Write("<script language=javascript>opener.window.navigate(''      .asp'');</script>") 


JS          

//              
<script language=JavaScript> 
   parent.location.reload(); 
</script> 

//         
<script language=JavaScript> 
    self.opener.location.reload(); 
</script> 
(   <a href="javascript:opener.location.reload()">  </a>   ) 

//              
<script language=JavaScript> 
   parent.  FrameID.location.reload(); 
</script><body><body onload="opener.location.reload()">       
<body onUnload="opener.location.reload()">       

<script language="javascript"> 
window.opener.document.location.reload() 
</script>