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 7508789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:44:22+00:00 2026-05-29T22:44:22+00:00

I basically nees a redirect, but the my problem is the first url must

  • 0

I basically nees a redirect, but the my problem is the first url must be stored otherwise the other page will not display.

how do i get jquery or javascript to store the current (or specified) url, then once stored it must load a different (specified) url?

  • 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-05-29T22:44:22+00:00Added an answer on May 29, 2026 at 10:44 pm

    You can’t simply store it in a variable, because when a new URL is loaded, the entire javascript context is new. You can store the current URL in a cookie, though.

    If you’re trying to pass the URL from one page to the next, the cookie approach will only work if the two pages are on the same domain.

    If you have any kind of server-side component in your stack (e.g. PHP) it seems like a more sensible approach would be to store the URL server-side.

    Edited to add: You requested sample code for the cookies. Reading and writing cookies in Javascript requires a certain amount of boilerplate code; there are example methods here or you can use a jQuery plugin.

    Once you have a simple way to write and read your cookies, you can just do (this syntax uses the jquery plugin)

    //assuming "newURL" hold the new url you want to load
    $.cookie("currentURL",window.location.href);
    window.location = newURL;
    

    Then on the next page you can get the old URL:

    var oldURL = $.cookie("currentURL");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I'm trying to determine the complete web-accessible URL of a certain script, but
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I am trying to restart a service from a php web page. Here
Basically I’ve heard that certain conditions will cause .NET to blow past the finally
basically i wish to achieve like user type file name,then video will be pop
Basically, I have a main page (parent page) with a link that opens up
basically i would like to display .doc file in WWW, i've tried to fetch
Basically I have an IFRAME that contains a given page - I want to
Basically, I would like a page that consist of a slideshow that contains a
Basically in my in my aspx page I have a gridview which displays the

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.