How to get return value of php function into my jquery script
I a writing a pic upload script. The script moves the pict开发者_运维问答ure 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?
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){}
});
Just echo the path in the php script and it will show up in the data argument of the ajax callback.
精彩评论