Learn How To Do

    See News Today

    14
    Sep

    Learn How to make a redirect page in jQuery/JavaScript?

    By admin|JavaScript, jQuery

    Here JQuery is not necessary. We can just use JavaScript to do that.

    And There are two methods to do that. One is window.location.href = and the other one is window.location.replace(…)

    window.location.replace(…) will best simulate an HTTP redirect. If you want to simulate someone clicking on a link, use location.href. If you want to simulate an HTTP redirect, use location.replace.

    Here are the examples.

    // similar behavior as clicking on a link
    window.location.href = "http://www.learnhow2do.com";
    
    // similar behavior as an HTTP redirect
    window.location.replace("http://www.learnhow2do.com");
    
    Tagged as: JavaScript, jQuery
    View More Posts:
    • ←
    • →

    Recent Posts

    • Learn how to fix “Only variable references should be returned by reference – Codeigniter”
    • How to change the battery of a Toyota Prius Smart Key
    • How Differential Steering Works (1937)
    • Learn English Word: “wear out”
    • Learn how to check a checkbox using jQuery

    Recent Comments

    • guitar body blanks on Learn how to use ffmpeg_php : ffmpeg_animated_gif object
    • tiffany Outlet Australia on Learn how to empty or truncate table using codeigniter active record
    • Concepcion on Learn how to do CSS triangle shape work
    • cheap cialis on Learn how to Redirect using PHP
    • that guy on Learn how to Redirect using PHP

    Archives

    • November 2016
    • June 2015
    • March 2015
    • November 2014
    • October 2014
    • May 2014
    • April 2014
    • December 2013
    • October 2013
    • September 2013
    • August 2013
    • July 2013
    • June 2013
    • May 2013
    • April 2013
    • March 2013
    • February 2013
    • January 2013
    • December 2012
    • November 2012
    • October 2012
    • September 2012
    • August 2012

    Categories

    • Command
    • Computer
    • Cooking
    • CSS
    • CSS
    • Draw
    • Driving
    • Engineering
    • English
    • GIT
    • Internet
    • JavaScript
    • jQuery
    • Languages
    • Mechanical
    • MySQL
    • PHP
    • Python

    Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
    free counters

    Powered by the inLine Minimal WordPress Theme