Solved

not updating screen after ajax call

Posted on 2015-02-04
1
61 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This article discusses how to implement server side field validation and display customized error messages to the client.
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)

726 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