Why is this jquery callback for complete not executed?

Why isnt Jquery callback isn't returning my data?

  • I have a simple post script that calls a php file that has a simple <h1>test</h1> inside of it. My jquery code is $.post("../test.php", dataString , function(data){ alert("Data Loaded: " + data); } ); Cany anyone tell me why no data is returned?

  • Answer:

    The likely event is that your $.post call cannot find your test.php file. Make sure the path to the file is correct before trying anything else.

danramos... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Try moving the test.php page to the same directory as your post request. Also download a firefox plugin called firebug, it'll alert to all sorts of problems when running javascript and whether or not you're successfully communicating with the web server. You could also try: $.ajax({ type: "POST", url: "../text/php", data: dataString, dataType: "text", success: function(text) { alert(text); }, error: function(xhr, status, errorThrown) { alert(errorThrown + '\n' + status + '\n' + xhr.statusText); } });

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.