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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:25:01+00:00 2026-05-13T20:25:01+00:00

I am at a loss here with some simple jQuery. I have the following

  • 0

I am at a loss here with some simple jQuery. I have the following code in a separate file:

 $(document).ready(function(){
    //$("#trackit").click(function() {  

    $.ajax({
       type: "POST",
       url: 'include/trackit.php',
       data: "trackingNum=123456",
       success: function(data) {
         alert(data);
       }
    });

   //});  
});

That works just fine, on page load it returns the expected data to the alert window.

But, if I remove the comments from this line:

$("#trackit").click(function() { 

to capture the form’s submit button, I get no return data.

Here is the abbreviated form info:

<form action="<?php htmlentities($_SERVER['PHP_SELF']);?>" name="tForm" id="tForm" method="post">

    <button type="submit" class="buttonTracking" id="trackit" name="trackit">Track It!</button>

</form>

Am I just overlooking some simple error here?

  • 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-13T20:25:01+00:00Added an answer on May 13, 2026 at 8:25 pm

    Correct working code would be this:

     $(document).ready(function(){
        $("#trackit").click(function() {  
    
        $.ajax({
           type: "POST",
           url: 'include/trackit.php',
           data: "trackingNum=123456",
           success: function(data) {
             alert(data);
           }
        });
        return false; // to cancel form submission and subsequent page refresh
       });  
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some C code that compiles to a DLL. From C#, I need
For general protocol message exchange, which can tolerate some packet loss. How much more
I have a simple web service sitting on our internal network. I used SOAPUI
I'm writing some code that plays back WAV files at different speeds, so that
I have some XML data retrieved from a web service that I use to
I'm at a complete loss here. A client of mine uses IE6 internally and
I get an input CSV file that I have to upload to my oracle
I'm at a complete loss here... I'm trying to convert a QImage to a
I'm having quite a weird problem here. I have just pasted the Yii folder
Here is my code: $buffer .= '<legend>'.$thisField.'</legend><input type=text name='.$thisField.' id='.$thisField.'/> <a href=javascript:; onClick=mcImageManager.browse({fields :

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.