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.
精彩评论