开发者

How to get return value of php function into my jquery script

开发者 https://www.devze.com 2023-04-09 19:55 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消