Harden up your ajax!
summary
XHR-focused checklist for real-world Ajax: log errors via window.onerror or framework hooks (Angular $exceptionHandler), capture stacks with stacktrace.js, and return rich error objects (like Google Maps’ status+message) instead of opaque 500s. Avoid blind automatic retries (built a jQuery retry plugin but warns it double-bills unless services are idempotent). Handle connectivity with local queues (localStorage/IndexedDB, Firebase, Hoodie/PouchDB), involve UX for the Pink Hippo optimistic-update pattern, and surface clear UI state for timeouts and aborted requests.
AI-written summary · about
chapters (9)
- 0:00Intro
- 0:23Reliability
- 1:01Ajax
- 3:44Demo
- 8:10Handling errors
- 9:49Status codes
- 10:45Errors
- 11:06Connectivity
- 11:54Dont do this
related talks
32mError handling: doing it right!
28mError handling: doing it right!
32mExpect the Unexpected: How to Deal with Errors in Large Web Applications
32mWriting Better Errors
42mBugs We Love
44mAdvanced JavaScript Techniques
23mDebug Like a Detective
54mHow to build the modern, optimistic and reactive user interface, we all want.
