Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated section "Receiving binary data in older browsers" #36947

Conversation

leon-win
Copy link
Member

Description

This PR removes outdated section "Receiving binary data in older browsers" from https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest_API/Sending_and_Receiving_Binary_Data document.

Related issues and pull requests

Fixes #36924

@leon-win leon-win requested a review from a team as a code owner November 24, 2024 15:07
@leon-win leon-win requested review from sideshowbarker and removed request for a team November 24, 2024 15:07
@github-actions github-actions bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Nov 24, 2024
Copy link
Contributor

github-actions bot commented Nov 24, 2024

Preview URLs

(comment last updated: 2024-11-26 17:44:42)

Copy link
Contributor

@broofa broofa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@@ -6,6 +6,8 @@ page-type: guide

{{DefaultAPISidebar("XMLHttpRequest API")}}

## Receiving binary data

The `responseType` property of the XMLHttpRequest object can be set to change the expected response type from the server. Possible values are the empty string (default), `"arraybuffer"`, `"blob"`, `"document"`, `"json"`, and `"text"`. The `response` property will contain the entity body according to `responseType`, as an `ArrayBuffer`, `Blob`, `Document`, `JSON`, or string. This is `null` if the request is not complete or was not successful.

This example reads an image as a binary file and creates an 8-bit unsigned integer array from the raw bytes. Note that this will not decode the image and read the pixels. You will need a [png decoding library](https://github.com/foliojs/png.js) for that.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should replace this with a link to https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder ?

Copy link
Member Author

@leon-win leon-win Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree 👍

Comment on lines 84 to 87

## See also

- [Downloading Binary Streams with Javascript XMLHttpRequest](https://web.archive.org/web/20071103070418/http://mgran.blogspot.com/2006/08/downloading-binary-streams-with.html) — explanation of receiving binary data in older browsers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would omit this. We don't generally document obsolete technology on MDN.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, removed this link 👌

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice work, thank you @leon-win !

@wbamberg wbamberg merged commit 51cf085 into mdn:main Nov 26, 2024
8 checks passed
@leon-win leon-win deleted the improve/Web/API/XMLHttpRequest_API/Sending_and_Receiving_Binary_Data branch November 26, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XMLHttpRequest "Receiving binary data in older browsers" section contains spammy link in code sample
3 participants