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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:41:55+00:00 2026-05-19T14:41:55+00:00

Simple question. I have the following HTML: <a rel=nofollow id=claim-job-link data-method=post class=button green claim-job

  • 0

Simple question. I have the following HTML:

<a  rel="nofollow" id="claim-job-link" data-method="post" class="button green claim-job" href=""><span class="button"> <span class="text"> Claim Job </span> </span></a>

And the following Jquery:

 $("#claim-job-link").bind('click', function(event) {
               event.preventDefault();
    });

which is called with no problems. Adding a breakpoint to the preventDefault shows that it is called. However, the browser is still redirected in both Chrome and Firefox. Anyone faced anything similar?


Edited to add

It looks like the the event is prevented at first and then jquery enters this code block:

 for ( i = 0, l = elems.length; i < l; i++ ) {
        match = elems[i];

        if ( maxLevel && match.level > maxLevel ) {
            break;
        }

        event.currentTarget = match.elem;
        event.data = match.handleObj.data;
        event.handleObj = match.handleObj;

        ret = match.handleObj.origHandler.apply( match.elem, arguments );

        if ( ret === false || event.isPropagationStopped() ) {
            maxLevel = match.level;

            if ( ret === false ) {
                stop = false;
            }
            if ( event.isImmediatePropagationStopped() ) {
                break;
            }
        }
    }

    return stop;
}

Then when it exits, it runs the does the redirect call.

Thanks

  • 1 1 Answer
  • 1 View
  • 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-19T14:41:56+00:00Added an answer on May 19, 2026 at 2:41 pm

    Thanks for your help guys. I figured it out though. In a rails app, when you call either :remote=>true or :method=>:xxx, it adds a tag to the link. This tag is processed by the rails app in such a way that the event.preventDefault call doesn’t work. By removing the :method attribute, the call now works. Go figure. Thanks again for all your help.

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

Sidebar

Related Questions

Simple quick question.... I have the following link html: <a href=http://www.site.com/ onmouseover= /> I
I have a simple question. I have the following html code <a href=# class=purchase>
Fairly simple question: I have an init method on my class that has the
Simple question: I have the following markup... <a href='#'> <img src='icon.png'> This is the
simple question :- i have the following simple if (..) statements :- if (foo
A little stuck here. I have a simple question I guess. Given the following
Simple regex question. I have a string on the following format: this is a
I have the following HTML: <div class=wrapper> <div class=label> foor bar baz </div> <img
I have the following simple code : HTML: <div> <img src='http://i51.tinypic.com/4kz4g5.jpg' /> </div> CSS:
I have a simple javascript question in the HTML page. In my case, 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.