Fetch API in JavaScript for AJAX Developers

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024

Комментарии • 34

  • @albertalbaba5101
    @albertalbaba5101 Год назад

    Brother! You maded it so simple that even a kid in prmary school will understand. Thanks

  • @atmanvisual190
    @atmanvisual190 3 года назад +1

    Man, I hate ajax. This truly is a game-changer.

  • @Igor34
    @Igor34 3 года назад +4

    Sorry Ajax, we have to break up

  • @AlThePal78
    @AlThePal78 3 года назад +1

    Now isnt using ajax allows you to load information without refreshing?

  • @nikhilmwarrier7948
    @nikhilmwarrier7948 3 года назад +2

    Something I always wanted to know
    Thanks!

  • @KeepLearing
    @KeepLearing 3 года назад +1

    For me, I understood fetch better than ajax but they don't want me to use fetch! They want me to stick to ajax apparently as ajax will most likely to work all the time but where as fetch won't always be supported due it being newer... 😫

  • @tomytoon123
    @tomytoon123 11 месяцев назад

    thnx this help a log even its already 2023 haha

  • @YagamiL
    @YagamiL 2 года назад +1

    Thanks!
    Could you please include the code under your videos pls? (I mean via a link obviously)

  • @vladosononame6376
    @vladosononame6376 3 года назад +1

    Thank you for explaination

  • @pipersaratoga8130
    @pipersaratoga8130 2 года назад +1

    Thanks! very clear and so beginner friendly

  • @cmtv357
    @cmtv357 3 года назад +1

    This is some good stuff. Thanks!

  • @amirrezaamini9907
    @amirrezaamini9907 3 года назад +2

    Really thanks! This was exactly what I wanted to learn. One more question, Which of the two last options is the best? (fetch.then or fetch async/await).

    • @dcode-software
      @dcode-software  3 года назад +3

      All good 🙂 either one is fine, there's no "best" only different ways to do it. If you want wider browser support then stick to .then - check out Can I Use website to see browser compatibility

    • @deewastamang9135
      @deewastamang9135 2 года назад

      Personally i prefer async/await func as it looks more cleaner. But both are good as they share the same purpose.

    • @amirrezaamini9907
      @amirrezaamini9907 2 года назад

      @@deewastamang9135 after 11 months lol, now I'm a Senior developer lol. Thanks btw

    • @deewastamang9135
      @deewastamang9135 2 года назад +1

      @@amirrezaamini9907 That's impressive! Good to know.

  • @nurullahanas4906
    @nurullahanas4906 2 года назад

    pull data from an external file on desktop with fetch api?

  • @ghassendhaoui2519
    @ghassendhaoui2519 Год назад

    i am working on a uni project right now in php and i need to use ajax in some parts, can i use fetch api with database?

  • @pjmclenon
    @pjmclenon 2 года назад

    hello reallyawesome explanation ; i get wait and then relation much clearer now and compared to callback ajax; i will keep practicing; i want to maention then these catch error functions i dont like cuz all they do is bring you to the line where the catch code was written not tothe actual line error; so i leave that catch error out so the defaut web console erro bring me to the actial error line; unless you know how to actully display the line error : thxz Lisa

  • @Lymphater
    @Lymphater 2 года назад

    Nice, but how to use timeout, f.i. if server does not response for >10s ?

  • @rendykurniawan3998
    @rendykurniawan3998 3 года назад

    One annoying part about native fetch method, it cant handle file upload progress.

  • @justnow7263
    @justnow7263 3 года назад

    Your tutorials are help ful.
    Love from hargiesa somaliland 💕🙏

  • @zainabal4667
    @zainabal4667 3 года назад

    Thank you! I have been trying to understand the difference and you explained it very well.

  • @AlThePal78
    @AlThePal78 3 года назад

    do you just add .json to a link ?

  • @leviuzodike9061
    @leviuzodike9061 Год назад

    So I understand why there would be an await before a fetch call, but is it really necessary to put an await before the "response.json()"? Wouldn't that function call be instantaneous since it's not getting anything outside of JS? Or do you just put an await before every function call of a promise?

    • @stanley9171
      @stanley9171 11 месяцев назад

      the response.json() method returns a Promise that resolves with the result of parsing the body text as JSON. Therefore, you do need to use await with it to ensure that the parsing completes before the next line of code runs. If you don't use await, the user variable would hold a Promise rather than the actual parsed JSON data.

  • @rangabharath4253
    @rangabharath4253 3 года назад

    Awesome as always 👍😀

  • @k.t.1594
    @k.t.1594 3 года назад

    Great vid!!

  • @vladosononame6376
    @vladosononame6376 3 года назад

    What local server you use for this tutorial?

  • @Videosuser
    @Videosuser 3 года назад

    Thanks