$ .post请求中的回调函数
16lz
2021-01-22
If you have a callback such as:
如果您有回调,例如:
function(data) {
process(data);
}
what exactly is data
? How would you specify what data
is if the url that the POST request is sent to redirects to your controller (let's say we're using Ruby on Rails.)?
究竟是什么数据?如果发送POST请求的url重定向到你的控制器,你会如何指定哪些数据(假设我们正在使用Ruby on Rails)?
2 个解决方案
#1
0
data
is the response from the server.
data是服务器的响应。
Depending on the type
of the jQuery AJAX request, it will be either a string, a parsed JSON object, or an XML DOM tree.
根据jQuery AJAX请求的类型,它将是字符串,解析的JSON对象或XML DOM树。
See the documentation.
请参阅文档。
更多相关文章
- 如何在Ajax.ActionLink中获取表单中的输入数据?
- 通过],[和创建json对象来分割字符串
- jQuery返回一个没有逗号的字符串的前5个单词
- 开发学习Jquery实例---双击表格弹出模态对话框,编辑提交数据
- 执行Django数据库值的计算:视图。py或Javascript模板吗?
- 将Object转换为字符串并返回[复制]
- 带有括号的某些字符串导致Ajax POST操作失败,出现403错误(禁止)
- jquery 如何获取json指定键为指定值的另一个指定键的值,该值还是
- Jquery 传json格式数据到后台,后台反序列化得到一个集合list