JS 페이지 전환 처리

4402 단어
js       
1.window.location.href  
    <script language="javascript" type="text/javascript">
           window.location.href="target.aspx"; 
    </script>

2.window.navigate    
   <script language="javascript">
    window.navigate("target.aspx");
</script>
 
3.window.loction.replace        ,           
<script language="javascript">
    window.location.replace("target.aspx");
</script>
 3 jsp  (1.aspx, 2.aspx, 3.aspx),       1.aspx,    2.aspx   , 2.aspx   window.location.replace("3.aspx");
  window.location.href ("3.aspx");
       
        ,   3.aspx     "  "  ,  window.history.go(-1); 
wondow.history.back();     ,            2.aspx    ,      ,   
window.location.replace("3.aspx");  3.aspx    ,3.aspx       
window.history.go(-1);wondow.history.back();       ,    1.aspx。

4.self.location        ,    top.location     
   <script language="JavaScript">
          self.location='target.aspx';
   </script>

5.top.location
   <script language="javascript">
          top.location='target.aspx';
   </script>
 
6.         
    <script language="javascript">
    alert("  ");
    window.history.back(-1);
   </script>
 
meta      (content = 3     )
<meta http-equiv=refresh content=3;URL="http://www.dayanmei.com">
 
   :
1. Javascript       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): 
[javascript] view plaincopy
<mce:script type=text/javascript><!--  
   
if (typeof SWFObject == "undefined") {   
document.write('<scr' + 'ipt type="text/javascript" src="/scripts/swfobject-1.5.js"></scr' + 'ipt>');}  
// --></mce: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  
[c-sharp] view plaincopy
<mce:script language="JavaScript"><!--  
   
function myrefresh()   
{   
       window.location.reload();   
}   
setTimeout('myrefresh()',1000); //  1        
// --></mce: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>         。 

[javascript] view plaincopy
<body onload="opener.location.reload()">         
<body onUnload="opener.location.reload()">         
  
<mce:script language="javascript"><!--  
   
window.opener.document.location.reload()   
// --></mce:script>

좋은 웹페이지 즐겨찾기