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

  • Home
  • SEARCH
  • 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 1050035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:42:36+00:00 2026-05-16T16:42:36+00:00

I am in debug mode, so I can see which page is being hit.

  • 0

I am in debug mode, so I can see which page is being hit.

When I call either window.location or window.location.replace(..) it goes to the page, but then back to the originating page!

How could this be??

The solution was to add:

    window.location.replace(...);

    return false;

Why does return false make this work properly now?

  • 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-16T16:42:36+00:00Added an answer on May 16, 2026 at 4:42 pm

    If this script happened on an onclick or onsubmit event, then no return or returning true will indicate that the browser should take the default action for the link/form. So, if you had an onclick handler like:

    <a href="http://www.google.com/" onclick="window.location = 'http://www.yahoo.com/';">
    

    Then the browser will go to Yahoo, then see that it should execute the link’s other action (navigating to Google). When you indicate return false;, the browser knows not to execute the next/default action.

    <a href="http://www.google.com/" onclick="window.location = 'http://www.yahoo.com/'; return false;">
    

    So, why does return false; make this work?

    For any event hander, to return true indicates to continue as normal and to return false means to stop trying to handle the event (prevents default handling and stops propagation), though there are arguments against using return false;.

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

Sidebar

Related Questions

Which tool can I use to see the call stack for a running process?
I have an importer process which is running as a windows service (debug mode
Sometimes my c++ program crashes in debug mode, and what I got is a
Do C#/.NET floating point operations differ in precision between debug mode and release mode?
When I run my Visual Studio Windows Forms application by clicking F5 (debug mode),
I want to define some member variable and some code just in Debug Mode,
In most C or C++ environments, there is a debug mode and a release
I can see line numbers in my error logs in our development environment, in
When using Aptana with PHP 5.2.3 in debug mode (using thread safe XDebug 2.1.0
Hitting debug will deploy the application to \program files\AppNamespace\AppName.exe and attach to it. However,

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.