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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:31:52+00:00 2026-05-11T16:31:52+00:00

I might be doing something stupid. But if I have a normal link like:

  • 0

I might be doing something stupid. But if I have a normal link like:

<div id="changeMe"></div>
<a href="/Not/Intercepted" id="interceptMe">A link</a>

and I attach a jQuery click event to the link like so:

$('#interceptMe').click(function() {
  $('#changeMe').text('Changed');
  return false;
});

Everything works peachy. The page does not get redirected to /Not/Intercepted, which is what I would think would be correct.

Now…

I introduct a ajax call like $.get to my click event and now my page will be incorrectly redirected to the page, which essentially overwrites the ajax call.

$('#interceptMe').click(function() {
  $.get('/Ajax/Call', goesIn, function(comesOut) {
  $('#changeMe').html(comesOut);
    }, "html");
  return false;
});

Is there a way to make jQuery or javascript still intercept the link click so it does not go to the href page? I want to keep the href for those users that aren’t enabling javascript. TIA!

  • 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-11T16:31:53+00:00Added an answer on May 11, 2026 at 4:31 pm

    instead of return false, use ….

    $("#interceptMe").click(function(event){
    
        event.preventDefault();
    
        // Ajax here
    
        return false; //for good measure
    });
    

    http://docs.jquery.com/Events/jQuery.Event#event.preventDefault.28.29

    I’ve had many issues with IE especially not listening to return false. Apparently so have others http://coffeeandpaste.blogspot.com/2009/02/javascript-onclick-return-false-does.html

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

Sidebar

Related Questions

This might seem like a stupid question I admit. But I'm in a small
I must be missing something stupid here but I can not see it. My
Wow, what a stupid question you might say. But is it possible? I have
I am a Android newbie. I guess I might be doing something stupid here.
I might be doing something wrong, cuz I'm using buildr for not so long,
This might be on the discussy side, but I would really like to hear
This might sound like a little bit of a crazy question, but how can
this might be a stupid question, but I'm using asp.net list control that creates
I can't seem to get a custom action working. I might be doing this
Might be subjective and/or discussion.. but here goes. I've been asked to estimate a

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.