Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Javascript.info Ebook Part 3: Additional Articles — Reading Guide
## 【One-Line Pitch】
A practical deep-dive into browser APIs and networking fundamentals for JavaScript developers who want to master popups, binary data, fetch, WebSocket, and security topics beyond the basics. Ideal for intermediate developers who have completed core JavaScript tutorials and now need production-ready knowledge of browser internals.
## 【Book Arc】
- **Opening (~0%–10%)**: Covers window management with `window.open`, popup positioning and feature flags, plus the Same Origin Policy — how browsers restrict access between windows and iframes from different origins.
- **Early (~10%–23%)**: Explores binary data handling with typed arrays (`Int8Array`, `Uint8Array`, etc.), `ArrayBuffer` views, `TextDecoder`/`TextEncoder` for string-binary conversion, and `Blob`/`FileReader` for file operations.
- **Early–Middle (~23%–39%)**: Moves into networking with `fetch` API — POST requests, `FormData` for multipart forms, `AbortController` for cancellation, and detailed `fetch` options like `cache`, `redirect`, and `credentials`.
- **Middle (~39%–48%)**: Covers XMLHttpRequest upload progress tracking via `xhr.upload`, long-polling for real-time communication, and introduces WebSocket protocol with frame types and handshake details.
- **Late (~48%–end)**: Discusses `EventSource` for Server-Sent Events (SSE), including reconnection behavior, message formats, and cookie security flags (`secure`, `samesite`).
## 【Key Takeaways】
- **Same Origin Policy is the security backbone** (Opening): Full access between windows/iframes only works when protocol, domain, and port match; otherwise only `location` writing (redirect) is permitted, never reading. This governs popup security and iframe embedding.
- **Typed arrays have 5 constructor variants** (Early): `ArrayBuffer` views, array-like copying, typed-array conversion (with value truncation), numeric length allocation, and empty creation — each serves different use cases for binary data manipulation.
- **`TextDecoder` bridges binary and strings** (Early): When binary data represents text, `TextDecoder` converts buffers to JavaScript strings with encoding support, while `TextEncoder` does the reverse — essential for file processing and network payloads.
- **`URL.createObjectURL` beats FileReader for display** (Early): For showing images or triggering downloads, creating a short URL from a Blob/File is simpler and faster than reading to base64 — though FileReader remains useful for reading content as text, ArrayBuffer, or data URL.
- **`AbortController` provides fetch cancellation** (Early): Create a controller, pass its `signal` to fetch, then call `abort()` — the promise rejects with `AbortError` which you must handle. Critical for user-initiated cancellations and timeouts.
- **Simple vs. preflight requests in CORS** (Early): GET/POST/HEAD with limited headers are "simple" and sent directly; everything else triggers a preflight OPTIONS request. Understanding this split explains why some cross-origin requests fail mysteriously.
- **`xhr.upload` tracks upload progress separately** (Middle): While `xhr.onprogress` handles downloads, `xhr.upload` fires `progress`, `load`, `error`, and related events during uploads — essential for file upload progress bars.
- **Long-polling requires server architecture awareness** (Middle): The client-side `subscribe()` pattern (fetch, handle, reconnect) is simple, but servers must handle many pending connections — Node.js backends typically cope better than PHP/Ruby process-per-connection models.
## 【Reading Tips】
- **Skim the popup window feature tables** (Opening): The `window.open` parameters list is reference material — read the Same Origin Policy section carefully instead, as it's the conceptual foundation for later security topics.
- **Deep-read the typed array constructor variants** (Early): This is dense but crucial — the 5 constructor behaviors (especially value truncation when converting between types) trip up many developers. Work through the code examples.
- **Focus on the `fetch` options matrix** (Early–Middle): The `cache`, `redirect`, and `credentials` options each have 4–6 modes with subtle differences. Create a cheat sheet for yourself; you'll reference it constantly in real projects.
- **Study the WebSocket handshake example** (Middle): The request/response pair shows exactly what headers matter (`Sec-WebSocket-Key`, `Sec-WebSocket-Accept`). Understanding the handshake demystifies why WebSocket connections sometimes fail.
- **Compare long-polling vs. WebSocket vs. SSE** (Middle–Late): These three real-time techniques have different trade-offs — the book presents them sequentially, so read them together to understand when to choose each.
## 【Coverage Limits】
This guide covers the excerpted portions of Part 3, which focus on browser windows, binary data, networking (fetch, XHR, WebSocket, SSE), and cookie security. The full ebook likely includes additional articles on other topics not represented in these excerpts.
##
Page 6
no,resizable=no,status=no,location=no,toolbar=no,menubar=no width=600,height=300,left=100,top=100`; open('/', 'test', params); These ones do not: ● http://ww...
t usually URL.createObjectURL(blob) is simpler and faster. URL.createObjectURL(blob) Blob to data url ● We need to revoke them if care ● No need to revoke an...
a conditional request if there is a cached response, and a normal request otherwise. Populate HTTP-cache with the response; ● "force-cache" – use a response...
ArrayBuffer , etc. No settings required: just send it out. When we receive the data, text always comes as string. And for binary data, we can choose between...
ade is attempted. We should listen to it, so that we should close the database (and probably suggest the visitor to reload the page, to load the updated code...
e starting property value and y = 1 – the ending value. So values y<0 move the property lower than the starting left and y>1 – over the final left . That’s a...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Javascript.info Ebook Part 3 Additional articles (Ilya Kantor, javascript.info)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Javascript.info Ebook Part 3 Additional articles (Ilya Kantor, javascript.info)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Javascript.info Ebook Part 3 Additional articles (Ilya Kantor, javascript.info)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment