Description:

In this article, I will explain how to go back to previous page using Jquery. 

History object is used to contain the Url visited by the user.

History.back() method is used to navigate to the previous Url from the browser history.

History.forward() method is used to navigate to the next page from the browser history.

Example Program:

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#btnPrevPage').click(function () {
                history.back();
                return false;
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button ID="btnPrevPage" runat="server" Text="Go back" />
    </div>
    </form>
</body>
</html>

In the above example, I am navigating to previous url on click event.


Back to previous page with jquery, Return to previous page using Jquery, History.back method using Jquery, back to the previous page using Jquery, Jquery return to previous page, Browser back button navigation, How to get previous page using Jquery

0 comments:

Post a Comment

 
Top