javascript - ajax函数的这些参数是如何工作的?

标签 javascript jquery arrays json ajax

我正在寻找一个包含以下代码的教程

enter image description here

但是我不明白什么是urlcachesuccess?它们是数组吗?它们如何工作?

最佳答案

您可以在下面找到说明:

<小时/>

缓存

Type: Boolean
A Boolean value indicating whether the browser should cache the requested pages. Default is true.
If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters.

网址

Type: String
Specifies the URL to send the request to. Default is the current page

成功(结果,状态,xhr)

Type: Function( Anything data, String textStatus, jqXHR jqXHR )
A function to be run when the request succeeds A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter or the dataFilter callback function, if specified; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object.

一切都在jQuery.ajax()中进行了解释文档

关于javascript - ajax函数的这些参数是如何工作的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55777398/

相关文章:

c# - 根据 DayOfWeek 对字符串数组进行排序

javascript - 在 native react 中获取具有数字键的对象值

javascript - $ ('#formID' ).submit 和 $ ('#formID' )[0].submit 有什么区别?

arrays - 快速将数组序列化为对象

javascript - Onchange 选择在 jquery 中每行的下一列输入字段上设置的项目值

jquery - jquery 中带有 css 的 class 属性

c++ - 指向数组的指针和指向数组第一个元素的指针之间的区别

javascript - 在 Function.prototype 上添加一个方法

javascript - 删除表中所有相同 id tr

javascript - 在js中查找某个对象的键值对中的特定值