programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Corsair to Web DevelopmentEnglish · 1 年前

XMLHttpRequest (XHR) Vs Fetch API

message-square
message-square
5
link
fedilink
5
message-square

XMLHttpRequest (XHR) Vs Fetch API

Corsair to Web DevelopmentEnglish · 1 年前
message-square
5
link
fedilink

Hi,

I discovered this webpage
https://developer.mozilla.org/en-US/docs/Glossary/XMLHttpRequest

Where it say

The Fetch API is the modern replacement for XMLHttpRequest.

Without further explain on why so…

Did you (yourself) migrated from XHR to The Fetch API ? and is it better ? or do you know any (not bias) article about it ?

What about performances etc…

Thanks

cross-posted on

https://lemmy.world/post/14707833

  • CorsairOP
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    1 年前

    Thanks @[email protected] weird because I can use XHR as async… see: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/open open(method, url, async)

    • SteveTech
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 年前

      Sure it let’s you use it asynchronously, but it predates and is not really compatible with JavaScript’s async/Promise API.

Web Development

webdev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development

What is web development?

Web development is the process of creating websites or web applications

Rules/Guidelines

  • Follow the programming.dev site rules
  • Keep content related to web development
  • If what you’re posting relates to one of the related communities, crosspost it into there to help them grow
  • If youre posting an article older than two years put the year it was made in brackets after the title

Related Communities

  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]
  • [email protected]

Wormhole

  • [email protected]
Some webdev blogs

Not sure what to post in here? Want some web development related things to read?

Heres a couple blogs that have web development related content

  • https://frontendfoc.us/ - [RSS]
  • https://wesbos.com/blog
  • https://davidwalsh.name/ - [RSS]
  • https://www.nngroup.com/articles/
  • https://sia.codes/posts/ - [RSS]
  • https://www.smashingmagazine.com/ - [RSS]
  • https://www.bennadel.com/ - [RSS]
  • https://web.dev/ - [RSS]
Credits

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 18 users / day
  • 7 users / week
  • 107 users / month
  • 895 users / 6 months
  • 1.16K local subscribers
  • 4.64K subscribers
  • 449 Posts
  • 1.49K Comments
  • Modlog
  • mods:
  • snowe
  • Erlingur
  • Ategon
  • BE: 0.19.13
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org