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
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:
- Why Isn't Montgomery Modular Exponentiation Considered For Use In Quantum Factoring?Best solution by cstheory.stackexchange.com
- Why isn't the text displayed in my Yahoo IM chat window?Best solution by in.answers.yahoo.com
- Why isn't my Yahoo my home page?Best solution by Yahoo! Answers
- Why isn't Yahoo letting me sign in?Best solution by Yahoo! Answers
- Why my new Msn isn't signing me in?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.