Solved

not updating screen after ajax call

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

Accepted Solution

by:
Chris Stanyon earned 500 total points
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

by Julian Matz As of jQuery (http://jquery.com/) 1.4 the .live() method (http://api.jquery.com/live/) supports custom events as well as some standard JavaScript events that it previously didn't support. Among these is the submit event. Unlike …
This article discusses how to create an extensible mechanism for linked drop downs.
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…

743 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

20 Experts available now in Live!

Get 1:1 Help Now