1/30/2014 8:11:36 PM
Viewed: 1422
tamkhong
2/5/2013 4:59:47 PM
5 ways to redirect URL with Javascript
How to do a Redirect to an HTTP POST Request with Javascript?I summarized 5 ways to redirect URL.(The purpose of below script is to perform a local redirect using Javascript)

1,
   <script language=”javascript” type=”text/javascript”>
   window.location.href=”login.jsp?backurl=”+window.location.href;
   </script>

2,
    <script language=”javascript”>
    alert(”back”);
    window.history.back(-1);
    </script>

3,
    <script language=”javascript”>
    window.navigate(”top.jsp”);
    </script>

4,
    <script language=”JavaScript”>
    self.location=”top.htm”;
    </script>

5,
    <script language=”javascript”>
    alert(”Access Violation”);
    top.location=”error.jsp”;
    </script>


Gửi trả lời