1

I a writing a pic upload script. The script moves the picture to a directory and also puts it into a database. I want to return the directory of this script to my Jquery function, and So I can then add it to a <iframe> or whatever. I hope that I am running the script, but I am not sure if that is indeed occurring. To make sure, how do I get the return value of a php function which is called by an $(jquery).Ajax() call?

1
  • $.ajax() will pass to your callback all the server-side script outputs. (In PHP, using echo, <?= ?>…) Commented Sep 29, 2011 at 1:21

2 Answers 2

1

I would suggest using google next time and also reading official manuals..

http://api.jquery.com/jQuery.ajax/

good luck!


this is what you are looking for.

$.ajax({
 success: function(data, textStatus, jqXHR){}
});
Sign up to request clarification or add additional context in comments.

Comments

1

Just echo the path in the php script and it will show up in the data argument of the ajax callback.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.