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

The Archive Base Latest Questions

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

When I refresh a page or redirect to the same one using the same

  • 0

When I refresh a page or redirect to the same one using the same url, I can click in a button with “window.history.back();” code and go back to the previous page.

However, If the query string was changed, I just back to the same page when I try to move back.

Example 1:

page1.html -> page2.html -> page2.html
-> [click back button] -> page1.html

Example 2:

page1.html -> page2.html ->
page2.html?x=123 -> [click back
button] -> page2.html

What I want:

page1.html -> page2.html ->
page2.html?x=123 -> [click back
button] -> page1.html

So, the question is, Can I check if the page is the same using JavaScript to ignore query string changes and move back to the real previous page?

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

    Use

    <a href="page2.html?x=123" 
    onclick="location.replace(this.href); return false">Next</a>
    

    to go forward while replacing the link in the history array

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Page A has a meta refresh to redirect to another page, C , after
I'm trying to refresh a page without sending POST from the previous time. I've
This relates to my previous post: jQuery .load Method causing page refresh AJAX I
How do I refresh a page in ASP.NET? (Let it reload itself by code)
When I redirect in a post going back to the page that shows the
When I refresh a page with Firefox, the values of the check boxes, input
instead of a whole page refresh after a certain time, i'd just like a
I've set up an AJAX page refresh with setInterval . From time to time,
As jquery ajax calls makes life really cool without a page refresh... But still
How do i update mysql database with ajax and php with no page refresh

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.