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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:19:31+00:00 2026-06-02T23:19:31+00:00

Maybe I am missing something simple here, but it is frustrating me. So what

  • 0

Maybe I am missing something simple here, but it is frustrating me. So what I need to do is update something on my server when this div around a link is clicked (I am doing click thru analytics). I figured I would do a click event and do an ajax call (via get).

$.get("stat/418491289);

But the problem is, the call isn’t being made. The user is being sent to the next page and not calling get call isn’t being completed/called. I would know because on the server it would update the database. Maybe I shouldn’t be making an ajax call, or maybe there is something I should be doing, but I am not sure. I cannot suspend the link action for now because it is wrapped in the div. What I would like to do ideally is fire off the request and then not worry about it. Updating the stat is not critical, so if it doesn’t work 1% of the time, that is more than ok. How would I do this?

I guess I might not be being clear. What I am asking is: Can I fire off a request to my server via javascript before the browser goes to the linked page? I don’t care what the response is, I just need to send the request.

  • 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-06-02T23:19:32+00:00Added an answer on June 2, 2026 at 11:19 pm

    if i have understood the question clearly you need to use preventDefault inorder to cancel the default behavior of the link like

    $("#linkID").click(function(e){
     e.preventDefault();
     //ajax call here
    });
    

    or put a return false;

    $("#linkID").click(function(){
    
         //ajax call here
         return false;
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe I'm missing something simple here, but when I run ruby script/server, I can
Ok, maybe I'm missing something here but I'm looking at various PHP hosting options
I may be missing something obvious here, but how could I rewrite this code
So, I may be missing something simple here, but I can't seem to find
I may be missing something really simple here, but I am trying to style
Maybe I'm missing something obvious, but I how can I view the expression tree
Maybe I am missing something, but in symfony examples, in form submission action there's
Maybe I'm missing something, but from Apple's documentation for NSHTTPCookieStorage , I can't help
Maybe I'm just missing something in the docs, but it seem it's not possible
I may be missing something here because I thought this might be really easy

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.