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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:48:04+00:00 2026-06-13T21:48:04+00:00

I try to make a jQuery.ajax call: jQuery(#search_form).live(submit, function() { search_nr = jQuery(#search_input).val(); jQuery.ajax({

  • 0

I try to make a jQuery.ajax call:

jQuery("#search_form").live("submit", function() {
    search_nr = jQuery("#search_input").val();
    jQuery.ajax({
        url: '/modules/mod_findarticle/process.php',
        data: "search_nr="+search_nr,
        async: true,
        'success':  function(data) {
                        alert(data);
                    },
        'error': function(jqXHR, textStatus, errorThrown) {
                  alert(jqXHR.status+",  " + jqXHR.statusText+",  "+textStatus+",  "+errorThrown);
        }
    });
});

In return i always get an alert with “0, error, error,” message. Everything’s fine with async=false.
I know that with asynchronous call the script finish work before any actual data is recieved but what can be done to avoid this?

  • 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-13T21:48:05+00:00Added an answer on June 13, 2026 at 9:48 pm

    Problem solved thanks to user mccannf :
    The data was submitted twice by triggering the ‘submit’ event on the form, so the script always stopped processing data before the second call. Replacing function() in .live(...) with function(e) {e.preventDefault; ... } disables the default submit action and hence does the trick!

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

Sidebar

Related Questions

When I make a jquery ajax call to auto fill a dropdown on page
I am trying to make an Ajax call with jquery, if I put an
I'm trying to make a jQuery .ajax() call to a public web service, and
I am new to JQuery. I've figured out how to make an AJAX call,
i make a Jquery function that (for the moment) call a function dinamically and
I am trying to make condition to call chain function in Jquery. I used
my client using jQuery 1.7 try to make a request to my server using
I try to use the columnFilter add-on of jquery datatable but I couldn't make
I'm pretty new to MVC . I need to make ajax call to an
I tried to make an contact form via AJAX with jQuery and Validation Engine

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.