Skip to content

Commit

Permalink
Update 06-HTTPandAJAX.md
Browse files Browse the repository at this point in the history
  • Loading branch information
grunenwald authored Oct 28, 2024
1 parent 7222f80 commit 70d119e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/06-HTTPandAJAX.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ $(document).ready(function(){
```

* [Tester][14]
* D'[autres][15] façons de faire

# XHR : propriétés et méthodes
* `readyState, status, onreadystatechange`
Expand Down Expand Up @@ -316,6 +315,11 @@ fetch("fichier.json")

* L'API fetch est native et utilise les [promesses][29] plutôt que les callbacks

# Autres alternatives AJAX

* Utiliser une bibliothèque comme [Axios](https://axios-http.com/docs/intro)
* [htmx](https://htmx.org/docs/#ajax) : html repensé pour l'utilisation post-2020

# Traitement d'erreurs
* Utiliser les [entêtes HTTP][24]
* Champ Status
Expand Down Expand Up @@ -369,7 +373,7 @@ myXHR.getResponseHeader("Status");
[12]:https://www.w3.org/TR/XMLHttpRequest/
[13]:https://www.xul.fr/xml-ajax.html#ajax-exemple
[14]:https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_load
[15]:https://code.tutsplus.com/tutorials/jquery-succinctly-jquery-and-ajax--net-33856
[15]:
[16]:https://stackoverflow.com/questions/367786/prevent-browser-caching-of-jquery-ajax-call-result
[17]:https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching
[18]:https://blog.teamtreehouse.com/the-definitive-guide-to-get-vs-post
Expand Down

0 comments on commit 70d119e

Please sign in to comment.