Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:18:14+00:00 2026-06-05T09:18:14+00:00

how to determine which page is redirected? i am using this code but this

  • 0

how to determine which page is redirected?

i am using this code but this is not helping what i am looking for:

   $(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();
        }
    });

EDIT:

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

the logic should be.

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

i hope it make sense and confused 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:18:18+00:00Added an answer on June 5, 2026 at 9:18 am

    If you want to know what was the page on which a link was clicked leading to your page, simply use the referrer : https://developer.mozilla.org/en/DOM/document.referrer

    A browser may be instructed to block it.
    A different (hackish) solution for your own site could simply be to store the page in localStorage :

       var lastPage;
       $(function() {
            var lastPage = localStorage['lastPage'];
            localStorage['lastPage'] = document.location.pathname;
       });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to determine programmatically, using Python, which web page is currently
Is there a way to determine programmatically, using Python, which web page is currently
For a personnal page I use the MultiViews options in Apache to determine which
Hi guys I am looking for a regular expression which will not match any
I'm looking to determine which element had the last focus in a series of
Okay, I do use firebug to determine when a function is not defined in
How I can determine which content page requested from master page load method?for ezample
I am creating a master page for admin-side of my application, which is using
I am trying to determine which implementation of the data structure would be best
How can you determine which rubygem is being used in response to a require

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.