开发者

What does the second part of this syntax mean on the jQuery API?

开发者 https://www.devze.com 2023-03-18 09:19 出处:网络
I have read the method signature: jQuery.getJSON( url, `[data,] [success(data, textStatus, jqXHR)]` ) 开发者_运维问答

I have read the method signature:

jQuery.getJSON( url, `[data,] [success(data, textStatus, jqXHR)]` )
开发者_运维问答

I am wondering what the part I have highlighted in quotes means? Why does it say [data,]? Why does it have two arguments in square brackets?

Shame the jQuery site doesnt tell you how to read the documentation...


I believe it is saying the function requires the first param, the second param is optional (data), and the 3rd param is also optional, and it is a callback taking 3 parameters that is called on success


The second and third arguments are optional.

The third parameter is a function with the given parameters which are passed to it if provided.


It means the argument is optional.


It means that these are optional parameters. It's a common pseudo-coded way of representing these in documentation papers.

0

精彩评论

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