Solved

not updating screen after ajax call

Posted on 2015-02-04
1
57 Views
Last Modified: 2015-02-06
I'm trying to build an import routine that will import multiple tables, what I want to do is get it to do one, then the next and the next, which I've got working, however it doesn't update the page when its got a response.

I've put the code in a jsfiddle, however it should display an error as it cant see the page its posting to.
http://jsfiddle.net/bj7ruvds/1/

I know why its not updating because Ive set "async: true", however if I set "async: false" then it only completes the last row as it doesnt seem to complete all the rows.

Does anyone have any suggestions on how I can either update the page when I get the callback, or execute the ajax calls one at a time and wait for previous to cancel.

Thank you in advance for any support.
0
Comment
Question by:tonelm54
1 Comment
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 40589234
Difficult to know with just your jsfiddle, but a couple of things of note. Your error function won't display the error because you're trying to set the html to 'data' which doesn't exist in your error function. You only have the variables jqXHR, textStatus, errorThrown, so set it to one of them, for example:

$tblRow.find("td:nth-child(4)").html(textStatus);

Open in new window


As to what would happen on success, without seeing exactly what your php script returns, it's impossible to tell.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Better way of using callback in javascript 7 73
jQuery Syntax 2 47
Angular - following an example but mine partly works 17 45
Clear single text form value in jquery 2 29
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.
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now