Solved

post send and wait all at once

Posted on 2015-02-04
1
79 Views
Last Modified: 2015-02-06
Im trying to build an import routine, and want to feedback the results.

I have built the following code on jsfiddle:-
http://jsfiddle.net/jmjc8djn/

I don't understand why all rows fire at the same time, and none respond. From my understanding it should .post the first row then display the results, then the next. However as you can see each Row gets the image and doesnt display anything (even though on jsfiddle it should just display and error saying it couldnt find it).

Any ideas what Im doing wrong?

Thank you
0
Comment
Question by:tonelm54
1 Comment
 
LVL 6

Accepted Solution

by:
rjohnsonjr earned 500 total points
ID: 40588956
You have to set the aync setting to false:

http://api.jquery.com/jquery.ajax/

async (default: true)
Type: Boolean
By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success().


by default the call is asynchronous so it doesn't wait for a response.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now