why cant I return data from $.post (jquery)

前端 未结 6 2464
南旧
南旧 2020-12-19 05:39

I must be making a silly mistake but I cannot return the data I get from a $.post function and store it in a variable, not only that, I cannot return ANYTHING from within th

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-19 06:12

    You don't return anything from post(). What you have inside function(data, status) {} is actually a callback and doesn't return a result to the post() method like you think.

    Have a read of the this article for more information

提交回复
热议问题