Solved

not updating screen after ajax call

Posted on 2015-02-04
1
58 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
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)

813 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