Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| webdev:javascript:basics [05/11/2018 18:43] – dolo | webdev:javascript:basics [02/12/2020 21:20] (Version actuelle) – [Basics] dolo | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Basics ====== | ====== Basics ====== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * ... | ||
| ==== Events ==== | ==== Events ==== | ||
| Ligne 8: | Ligne 11: | ||
| * On Chrome **e.originalEvent.screenX** take different values than **e.originalEvent.clientX**, | * On Chrome **e.originalEvent.screenX** take different values than **e.originalEvent.clientX**, | ||
| + | == Pass additionnal parameters to an event using jQuery .trigger() == | ||
| + | <Code linenums> | ||
| + | // Trigger | ||
| + | $(' | ||
| + | { | ||
| + | console.log(e); | ||
| + | console.log(e.pageX); | ||
| + | $(' | ||
| + | }); | ||
| + | |||
| + | // We get the value as | ||
| + | $(' | ||
| + | { | ||
| + | console.log(e); | ||
| + | console.log(altPageX); | ||
| + | }); | ||
| + | </ | ||
| + | == Debouncing / Throttle == | ||
| + | * [[https:// | ||
| + | Throttle : Similar to debouncing but ensure a minimum execution of the function every fixed time | ||
| + | * [[https:// | ||
| + | |||
| + | Using jQuery' | ||
| ==== Promises ==== | ==== Promises ==== | ||
| * https:// | * https:// | ||