|
|
1
5
您正在为$.post提供回调函数,该函数将在返回请求时运行。服务器请求函数立即返回(即在响应可用之前),因此responsetxt仍然为空。 要解决此问题,可以将回调参数添加到服务器请求,然后在提供给$.post调用的匿名函数中执行它:
有关详细信息,请查看连续传递样式( http://en.wikipedia.org/wiki/Continuation-passing_style http://matt.might.net/articles/by-example-continuation-passing-style/ ). |
|
|
2
3
您可以获取返回值,但仅当执行同步调用而不是异步调用时:
|
|
|
James Williams · 如何在单击按钮时刷新div内容 4 年前 |
|
|
Mehmet · javascript执行了多个 4 年前 |
|
|
Shijil · 尝试在Jquery PHP搜索代码中添加选择标记功能 4 年前 |
|
|
Parker · 如何使表格行的单元格项加粗n秒? 4 年前 |
|
|
Chris J. · ajax获取查找数据属性值的请求 4 年前 |
|
|
Pedro F · Ajax调用后脚本运行不正常 4 年前 |