Search This Blog

Monday, April 27, 2015

JAVASCRIPT/ JQuery Page Redirection

 

JAVASCRIPT/ JQuery Page Redirection

 

1. window.location.href="http://www.yahoo.com";

2. window.history.back(-1);                                     //  back

3. window.navigate("top.jsp");                                  // old-IE-only

4. self.location="top.htm";

5. top.location="error.jsp";

6. window.location = window.location.host;

7. $(location).attr('href',"http://www.yahoo.com");            //jQuery

8. $(window).attr("location","http://www.yahoo.com");        //jQuery

9. window.location.replace("http://www.yahoo.com");

10. window.location.assign("http://www.yahoo.org");

11. document.location.href = '/path';

12. window.history.go(-1);                                     //  back

13. $(location).prop('href',"http://www.yahoo.com");          //  jquery 

14.setTimeout(function(){
              window.location.href="<%=url%>"; // redirect after 5 seconds
   }, 5000);
 

My Blog List