Oct 25, 2014

Go Back To Last URL Using Java Script

Normally Web Sites Contains Many Pages. To Come To The Last Visited You Can Clicked The Browser's Back Button. It Will Take You To Lat Visited URL. That Mean Last Web Page You Have Visited. As A Developer You Can Create A Button To Do That. That Will Make Your Web Site More User Friendly.

Simply Use Following Code To Do That

function goBack() {
    window.history.back()
}


This Is A Simple Exam That Use Go Back To Last Visited URL Function.

First.html
<html>
    <head>
        <title>Easy Code Stuff - First Page</title>
    </head>
    <body>
        <h2>This Is The First Page</h2>
<a href="Second.html">Click This To Go To Second Page</a>
    </body>
</html>

Second.html
<html>
    <head>
        <title>Easy Code Stuff - Second Page</title>
<script>
           function goBack() {
                window.history.back()
            }
</script>
    </head>
    <body>
        <h2>This Is The Second Page</h2>
<p>Click The Below Button To Go To Last Page</P>
<input type="button" value="Go Back" onclick="goBack()"/>
    </body>
</html>


No comments:

JWT Token Decode Using Jquery

When it come to authentication we use many mechanism. Ones the user authenticated we must keep these details somewhere safe. So we can share...