Interpretation de syntaxe (crochets)
Posté : 13 mars 2020, 17:21
Hello !
Un truc que je n'ai JAMAIS compris (aucune explication trouvé d'ailleurs), c’est la syntaxe explicative, que ce soit de fonction php, js jquery ou autre...
Prenons cet exemple (ok c'est jquery mais dans le manuel php c'est le même genre de truc tordu) :
https://github.com/mgalante/jquery.redirect
Existe-t(il un document expliquant les syntaxes explicatives ?
Merkouin et bon OuiK !
Couin
Un truc que je n'ai JAMAIS compris (aucune explication trouvé d'ailleurs), c’est la syntaxe explicative, que ce soit de fonction php, js jquery ou autre...
Prenons cet exemple (ok c'est jquery mais dans le manuel php c'est le même genre de truc tordu) :
https://github.com/mgalante/jquery.redirect
et dans l'exemple :Usage
/**
* jQuery Redirect
* @param {string} url - Url of the redirection
* @param {Object} values - (optional) An object with the data to send. If not present will look for values as QueryString in the target url.
* @param {string} method - (optional) The HTTP verb can be GET or POST (defaults to POST)
* @param {string} target - (optional) The target of the form. If you set "_blank" will open the url in a new window.
* @param {boolean} traditional - (optional) This provides the same function as jquery's ajax function. The brackets are omitted on the field name if its an array. This allows arrays to work with MVC.net among others.
* @param {boolean} redirectTop - (optional) If its called from a iframe, force to navigate the top window.
*/
$.redirect(url, [values, [method, [target, [traditional, [redirectTop]]]]])
Où sont passés tous les crochets imbriqués les uns dans les autres ? C'est totalement incompréhensible ce délire ...$.redirect("/login.php", {user: "johnDoe", password: "12345"}, "POST", "_blank");
Existe-t(il un document expliquant les syntaxes explicatives ?
Merkouin et bon OuiK !
Couin