Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How can I make a redirect page using jQuery?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 293
    Comment on it

    To redirect page using jQuery we can use the various methods such as

    1. In JQuery we can use location object which as multiple attribute such as host, hostname, href, origin, protocol etc, and we can set the href attribute to our custom URL, which redirect to the page which we have specified.
    2. Example :

      $(location).attr('href',"http://findnerd.com"); 

    3. window.location.href : This will return the current URl, but by assigning your custom URL or Page Name, you can redirect to another page.
    4. Example :

      window.location.href = 'Home.aspx';

    5. window.location.replace : This can be used as a method and we can pass our custom URL as it's parameter, and call this method, which will replace the current url and than your can not go back to previous page that you might have accessed.
    6. Example :

      window.location.replace('Home.aspx');

    7. window.location.assign: This can also be used as a method and we can pass our custom URL as it's parameter, and call this method, which will assign a new url and redirect to new page.
    8. Example :

      window.location.assign('Home.aspx');

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: