How to know which page is redirected? in javascript
<p>how to determine which page is redirected? </p>

<p>i am using this code but this is not helping what i am looking for: </p>

<pre><code>   $(function () {             
        //var locate = window.location;
        //var t = window.location.hash;
        var pagename = location.pathname.substr(location.pathname.lastIndexOf("/") + 1, location.pathname.length).toLowerCase();
        if (pagename == "toppages.aspx") {
            $('#back_to_your_list').show();
        }
        else {
            $('#back_to_your_list').hide();
        }
    });
</code></pre>

<p>EDIT:</p>

<p>So, I have a link on my home page (<code>mydomain.com/employee/default.aspx</code>) and once the user click on it then this will redirect to another page (<code>mydomain.com/employee/toppages.aspx</code>) from it there are other links and say the user click on a link called <code>Background check</code> and this will redirect to a different page and this time the url of this page will be  (<code>mydomain.com/employee/toppages.aspx?id=123</code>) </p>

<p>the logic should be.</p>

<p>if the page is coming from <code>mydomain.com/employee/toppages.aspx?id=123</code> then <code>$('#back_to_your_list').show();</code> otherwise <code>hide</code></p>

<p>i hope it make sense and confused :)</p>
