Asynchronous JavaScript #2 - AJAX Requests

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

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

  • @lazlowcarmichael1829
    @lazlowcarmichael1829 8 лет назад +103

    This series is probably the best explanation of async I've come across. Thanks so much.

    • @NetNinja
      @NetNinja  8 лет назад +6

      Thanks :). Glad you liked!

    • @raymondmichael4987
      @raymondmichael4987 6 лет назад +1

      Lazlow Carmichael, your totally right

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

      pro tip: you can watch series on Flixzone. Me and my gf have been using it for watching loads of movies during the lockdown.

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

      @Dayton Alvaro yup, have been using Flixzone} for since december myself :D

  • @albertlewis332
    @albertlewis332 5 лет назад +13

    I've watched more than 200 videos on youtube about programming from different teachers and by far your are the most articulate and easy to follow-up. Your content is awesome and video editing skills are outstanding. Thank you so much and I look forward to buy some of your merchandise.

    • @NetNinja
      @NetNinja  5 лет назад

      Thank you so much for the nice comment!! Really glad you like them & hope to see you in a net ninja t-shirt sometime :D

  • @umaralli6535
    @umaralli6535 7 лет назад +1

    Dude.. you running a university here lol. Best tutorials I have ever come across ... I am using to learn new skills so I can build my startup .... I will always give credits to you man

  • @neildordavis8164
    @neildordavis8164 6 лет назад

    You have an excellent ability to simplify some of the more complex parts of programming.There isn't a single one of your videos that I have struggled to understand so far. I really appreciate your work - thanks!

  • @Mathspy
    @Mathspy 7 лет назад

    You know the best part is that I never really understood the XMLHttpRequest thing and always just did it with jQuery until today, I have no idea how you explain things so damn well. Thank you!

  • @yanivsalman9685
    @yanivsalman9685 6 лет назад +30

    how can someone dislike that? that was a in depth explanation on that xmlhttp stuff. very good explanation

    • @NetNinja
      @NetNinja  6 лет назад +2

      Thanks man :)

    • @yanivsalman9685
      @yanivsalman9685 6 лет назад +1

      no problem! just one Question : DomContentLoaded video its like the "document.ready" in Jquery? or it different? thanks!

    • @NetNinja
      @NetNinja  6 лет назад +3

      Hey, yeah, these two do the same thing. They wait until the document is ready.

    • @arjunsingh-eu5or
      @arjunsingh-eu5or 5 лет назад

      Because he not use full screen

    • @blendjams
      @blendjams 4 года назад

      XML users obviously

  • @jerrywebster7678
    @jerrywebster7678 8 лет назад

    Hello Ninja. I heartedly enjoyed this video. Might I say, it's one of the most pellucid lessons on javascript ajax requests on RUclips. I especially relished the lesson being first given in plain vanilla javascript before moving forth to the library. Thank you.

  • @oieesah
    @oieesah 7 лет назад +1

    This series is probably the best explanation of async I've come across. Thank you so much!

  • @artrocks8392
    @artrocks8392 7 лет назад

    This is superb work, thank you. Hope you're being rewarded for your efforts.
    I like the way you talk and explain as you code! Something so simple as "If readystate is equal to 4"... has fixed the meaning of == meaning equal in my mind, which I could not get used to before!
    Thank you again,
    Paul

  • @kajetanraducki9117
    @kajetanraducki9117 6 лет назад

    These a few videos are the best explanation of asynchronous JS I have ever seen. Thanks!

  • @Claymore2408
    @Claymore2408 6 лет назад

    These tutorials are amazing, so quick and so precise - better than most paid tutorials I've taken.

  • @New2Hackintosh
    @New2Hackintosh 6 лет назад

    This video series is great!!! Keep up the good work Net Ninja...I just wanted to mention that!!!
    To enable/use the Atom-Live-Server package that is used in this course which he talks about @ 2:41 of this video (you must first use Atom then install the Atom-Live-Server package of course) enable/Start it by choosing it in the "Packages" menu drop down and right clicking "Start". If you try to just use Chrome or any other browser you will get an error when trying to access the tweets.json file (or any other json file) due to browser security not allowing cross browser connectivity. Also make sure that when pressing the key combination Ctrl-Alt-4 (or whichever number you want to enable the browser port) that you use the number key above the letters on your keyboard. Using the keypad number key may not work!!!!

  • @samehabbadi8243
    @samehabbadi8243 6 лет назад

    I have a lot of thanks, not questions.
    You are giving me hopes I believed its just wishes.
    Love you every minute I am alive with every word I
    learn from you.
    Thank you.

  • @elkhanhamet2561
    @elkhanhamet2561 6 лет назад +1

    Mate, you're a lifesaver!!! Absolutely the best tutorial on all this stuff, crystal clear. God Bless!!!

  • @Gjacolby83
    @Gjacolby83 7 лет назад

    Even thought I think I have a good idea of how async code works, I love watching the video's that you guys put out. They are really great!

  • @ehza
    @ehza 6 лет назад

    You are absolutely a ninja for explaining complex thing.

  • @romeosincere117
    @romeosincere117 6 лет назад

    Very good video. One of the few to explain tiny but important details when using vanilla JS .

  • @FarukShaikh12
    @FarukShaikh12 5 лет назад

    @0.10 is awesome, video starts in ninja style. You are truly a ninja 🤣

  • @charleslesagedelavarenne5599
    @charleslesagedelavarenne5599 6 лет назад

    Crystal CLEAR !!!
    Excellent job Master Ninja!

  • @legendaryknight6462
    @legendaryknight6462 4 года назад +1

    missed you after some time :D, You are part of my educational life for ever :)

  • @greatnile
    @greatnile 8 лет назад +2

    You are the master of simplification. Can't wait for the generators part ;)

  • @HarshSharma-ru7ip
    @HarshSharma-ru7ip 5 лет назад +1

    Your videos are awesome dude!!
    Being following your videos since passport oauth ,best tutorial available👍

  • @mastercode7851
    @mastercode7851 4 года назад

    even after 3 years this is so good thanks mr ninga

  • @user-ph2bc8kc6c
    @user-ph2bc8kc6c 6 лет назад

    Marvelous! Concise and right to the point! Loved the iteration of explanations!

  • @trungpham7588
    @trungpham7588 8 лет назад +19

    Really easy to understand.. Thanks guy!

  • @surajranabhat9911
    @surajranabhat9911 6 лет назад

    Beats every explanation out there in Udemy.
    Blend of short + comprehensive

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

    That title font "Quicksand Book Regular" is beautiful : )

  • @shivamkumarchauhan9648
    @shivamkumarchauhan9648 6 лет назад

    This is the best video to understand AJAX requests.Thanks!

  • @huseyngadirov7658
    @huseyngadirov7658 8 лет назад +17

    This guy is simply awesome

  • @rayaqin
    @rayaqin 6 лет назад +2

    I really love the intro, how you slam the first slide in with that sound :D

  • @suffererandwitness3389
    @suffererandwitness3389 7 лет назад

    awesome. looking forward for more advanced topics on JS

  • @leanprogrammer
    @leanprogrammer 8 лет назад

    awesome!! extremely glad to have found this channel!

  • @kevingeorgex
    @kevingeorgex 7 лет назад

    This is awesome :) For the first time i understand what's actually going on !

  • @raviray6576
    @raviray6576 7 лет назад

    One of the Best explanation ever.

  • @mahmoudzakria6946
    @mahmoudzakria6946 8 лет назад +1

    I've never imagined that ajax is that so easy !!!
    Thank you ninjaaa

    • @mahmoudzakria6946
      @mahmoudzakria6946 8 лет назад

      but i got a question when you invoked the two http methods open and send after the onReadyStateChange function
      why is it legal and working correct ? is it because hoisting ?

    • @mahmoudzakria6946
      @mahmoudzakria6946 8 лет назад

      I mean why the initializing function comes at the first ?

  • @imadabab
    @imadabab 5 лет назад

    In brief, 7 Stars. Thanks a lot.

  • @НаталіяЖидейкіна
    @НаталіяЖидейкіна 8 лет назад

    You are genius. Your videos are perfect.

  • @LookNumber9
    @LookNumber9 8 лет назад

    Beautifully explained. Thank you!

  • @christopherparker6597
    @christopherparker6597 7 лет назад +1

    Love the tutorials. Information is always perfectly presented for any level of coder. Any plans on a object oriented php, or maybe just php for beginners tutorial?

  • @alokkumarpadhi4557
    @alokkumarpadhi4557 6 лет назад

    very helpfull video.Finally i understand what exactly ajax

  • @respotheme85
    @respotheme85 7 лет назад +6

    I can only give you one thumbs up :(. Please keep making awesome tutorials like this

    • @NetNinja
      @NetNinja  7 лет назад +2

      Ha, thanks :). I will.

  • @ram_pednekar14
    @ram_pednekar14 6 лет назад

    Very well Explained. Thanks for the hard work.

  • @srinathchandra7238
    @srinathchandra7238 7 лет назад

    Really you are superb man...i learn a lot of things.....

  • @niveditasharma5559
    @niveditasharma5559 4 года назад

    I enrolled for Modern JavaScript (From Novice To Ninja) course on Udemy.
    Once I complete the course dedicatedly, I will be black belt JavaScript developer....
    Whoahhhhhhhh

    • @NetNinja
      @NetNinja  4 года назад

      Awesome! Thanks so much :)

  • @batistababu3038
    @batistababu3038 5 лет назад +1

    Thanks, mate.Really great explanation.

  • @shototodoroki4945
    @shototodoroki4945 6 лет назад

    Damn. simply the best explanation on async

  • @rGGdom
    @rGGdom 7 лет назад

    subscribed! your content is great. Please keep up the good work!

  • @venkatbhushan4321
    @venkatbhushan4321 6 лет назад +1

    you are an awesome teacher..

  • @KaTheMagician
    @KaTheMagician 8 лет назад +1

    jQuery + AJAX version of these ever coming? Specifically just using the $.ajax() method / object to make get and post request successfully? Pretty familiar with get but post is still sort of foreign as you need a backend(server) set up to handle them I believe. Some tuts where you set up a quick and dirty server using express and node (because keep everything javascript why not :) lol) would be great. Anyways good stuff man. I started with with your node series. Then did the vanilla js and jQuery series for some review / refresher and you make the material very easy to digest. I'm subscribed!

    • @NetNinja
      @NetNinja  8 лет назад +1

      Hey - yeah, I'm thinking of doing a mini series on AJAX with jQuery soon :). Thanks so much for subbing - really hope the rest of the vids I've uploaded so far can be of some use :)

  • @pikachu5223
    @pikachu5223 7 лет назад +1

    What a great explanation! Thanks dude 😇

  • @petrkosvanec
    @petrkosvanec 6 лет назад

    1) Start / stop atom-live-server via Packages, Atom live server. 2) Use none .atom-life-server.json file. 3) In Mozilla the console on the right (used since 5:30) is at Open menu, Web Developer, Web Console.

  • @sarvarsharapov3004
    @sarvarsharapov3004 6 лет назад

    awesome explanations :-) Thank you so much

  • @chethankambi31
    @chethankambi31 5 лет назад +1

    @The Net Ninja - First of all your videos are awesome! Very easy to follow and grasp! :)
    Can you please list out or make a video on the "order in which one should learn JS concepts/topics" to become a pro!.
    Thanks in advance!!!

  • @sularaperera2719
    @sularaperera2719 6 лет назад

    Best explanation ever. Thank You So much. Please start a online course on JS and React. Thanks again..😊😊😊

  • @nathanboaldin7495
    @nathanboaldin7495 7 лет назад

    This is so helpful! Thank you for this!

  • @jatinwadhwa7050
    @jatinwadhwa7050 6 лет назад

    Thanks a lot! Really clear explanation.

  • @hansschuijff
    @hansschuijff 7 лет назад

    Great tutorials you share, Shaun, I love how you build it up so anyone should be able to follow. Thanks for the work!!
    I have some notes on this tutorial, for what it's worth...
    1. The description seems to have some errors. I couldn't find a repository, so I just typed as you went, and the editor you link to isn't the one you actually use here.
    2. Following the examples my console.log showed an error "XML Parsing Error: not well-formed
    Location: file:///D:/Hans/Downloads/The%20Net%20Ninja%20(Web%20Dev%20Tutorials)/Asynchronous%20Javascript%20Tutorial/bestanden/data/tweets.json
    Line Number 1, Column 1:"
    3. The jQuery method didn't work at all and just showed the xml error like above.
    instead of using $.get() it only worked when I changed it to $.getJSON(data/async.
    Just letting you know. Thanks for the great work!!

  • @he01682936
    @he01682936 5 лет назад

    it's very useful and clear, thanks a lot.

  • @kimonushki
    @kimonushki 8 лет назад +1

    Holy Beard of Zeus thank you so much for this! You just alleviated some immense frustration.

    • @NetNinja
      @NetNinja  8 лет назад +1

      Amazing, I have to use this saying. :)

  • @dhanushkafernando6316
    @dhanushkafernando6316 4 года назад

    simply 'The best'.

  • @kidconcept
    @kidconcept 7 лет назад

    Really well done, thanks!

  • @OptimalTrainingGroup
    @OptimalTrainingGroup 4 года назад

    Excellent!!!

  • @davideugene7911
    @davideugene7911 6 лет назад

    Salut.
    C'était nickel.
    Merci bien et en avant pour la suite :-D
    Ciao ;)

  • @gangadharkaranapu9062
    @gangadharkaranapu9062 6 лет назад

    Good Stuff. Q 1) How to make Synchronous Call through jQuery ajax?
    2) How the functions like onreadystatechange are added and called dynamically [behind the scenes in js] to objects of XMLHttpRequest?

  • @osamagamal495
    @osamagamal495 4 года назад

    currently, You don't have to use onreadystatechange and checkif it equals 4.
    we can use onload and it'll do this extra work for us.

  • @nathanbrunetti9852
    @nathanbrunetti9852 6 лет назад

    I really like how simple this video is, very well done. But I'm wondering if you have any videos that show how to connect to a database and return data where the DB is requesting to use credentials, like username and API key. Any help is greatly appreciated. Thanks!

  • @cathaldolan7113
    @cathaldolan7113 4 года назад

    Great tutorial, but I'm a little confused about the JQuery code. What other code needs to be kept and what is it replacing that can be removed? Thanks.

  • @stefc4663
    @stefc4663 6 лет назад

    Better than Udacity’s Ajax course

  • @brucelee7782
    @brucelee7782 5 лет назад

    Hi Ninja, at 10:00, what determines that console.log('test') is going to be returned first? Is it because the http request takes longer to retrieve the data as compared to console.log?

  • @meonitelexdee3432
    @meonitelexdee3432 7 лет назад +2

    the course link is actually not correct. it goes to some different stuff.
    You use Atom, not Brackes as you say in the description.

  • @henok-micrometremicrometre2563
    @henok-micrometremicrometre2563 8 лет назад

    great work thanks

  • @feliarana
    @feliarana 8 лет назад +2

    you're my god damn hero

  • @ethashamuddinmohammed1255
    @ethashamuddinmohammed1255 7 лет назад

    Mr Ninja, Why people say, reload of page is not needed, using AJAX? AJAX is basically to avoid blocking of page from use action on webpage, when browser is busy making IO with server. Isn't it?

  • @xanyula2738
    @xanyula2738 4 года назад

    what I want to know is this just one aspect of ajax, or is this course about everything that can be done with AJAX summarized

  • @richardblackdog3966
    @richardblackdog3966 7 лет назад

    Great tutorial as far as the javascript goes, but I would like there to be a bit more information on how to set up the dev environment and actually run the code. I am using Atom and have the atom-live-server plugin installed, but it just opens up a browser tab listing the source code. It doesn't run anything. I know how to embed a script in an html page but the impression given by this tutorial is that you can just run the JavaScript as is.

  • @maritaslagyan1702
    @maritaslagyan1702 5 лет назад

    This seems like a very clean cut way to get data, so why do people use fetch and axios? I know that they both technically use the XMLHttpRequest object internally, but why not just use the way it was done here? I'm trying to understand the differences between these three.

  • @Zihad
    @Zihad 6 лет назад

    Really good, but why don't you use auto-completion when it comes up?
    Is that a bad practice somehow?

  • @robertblack7698
    @robertblack7698 6 лет назад

    Life saver.

  • @domjanzsoo
    @domjanzsoo 8 лет назад

    Good tutorial , well done. My ajax request is not going until the step 4. It looks it's stucked at 3.What could be the reason of it?

  • @MrSULTANC2
    @MrSULTANC2 7 лет назад +6

    is onreadystatechange an event , like onload and onclick?

    • @cw5948
      @cw5948 6 лет назад

      The onreadystatechange property defines a function to be executed when the readyState changes.

    • @MakeRandomVids
      @MakeRandomVids 6 лет назад

      @@cw5948 So does that mean, we don't have to 'call' the function as in "http.onreadystatechange()" to execute it? It looks to me as if assigning a function to a method, therefore I thought we needed to 'call' it. Learning basics here..

  • @justindequillo1536
    @justindequillo1536 7 лет назад

    I'm following your tutorials bro , your the best haha . can you make some tutorials about php & laravel . thanks a lot ...

  • @justkamilcom7721
    @justkamilcom7721 8 лет назад +3

    Hi what exactly is JSON ? Did you say something about it before ?

    • @paweer.4925
      @paweer.4925 8 лет назад +9

      JSON is the way of storing data, as XML (html tag syntax) but with JavaScript syntax (objects and arrays)

  • @valikonen
    @valikonen 8 лет назад

    When are you using JSON.stringify() vs. JSON.parse()?

  • @eduardojreis
    @eduardojreis 4 года назад

    Thanks a lot. Great tutorials. I can't find those files on the repo.

  • @TheEmgriffiths
    @TheEmgriffiths 6 лет назад

    Good video

  • @karlsruhermusic
    @karlsruhermusic 4 года назад

    Thanks!

  • @Anastasia0150
    @Anastasia0150 8 лет назад

    Thanks! The tutorial is very helpful;) By the way, is there a way to save a chunk of data from the request to pass it to a different API? I created a function that connects to the Google maps API but I failed to pass the data I got to connect to the Dark Sky Weather API. The function returns "undefined" every time I try to store the data from Google in a variable.

  • @jassehomar
    @jassehomar 6 лет назад +2

    where can I get the source code for this tutorial?

  • @returnedfaith7254
    @returnedfaith7254 6 лет назад

    Whoah! Got heart arrest.

  • @amrayoub3508
    @amrayoub3508 8 лет назад

    hello , great course, i have a question
    how can i create a function If there is 5 or more ongoing requests, you have to wait until one
    of them is completed then you can process next request.
    When the response code is not 200, you need to retry 3 times. If the response code after
    retrying 3 times is still not 200 then the error function should be executed.

  • @shadmanmartinpiyal4057
    @shadmanmartinpiyal4057 4 года назад

    May 2020, if you are using VS code, you have to use VS Live Server, otherwise you will get an error of CORS which won't let you to access local files file tweets.json

  • @arminharper510
    @arminharper510 5 лет назад

    can i save the text,sent by the user in Mysql as JSON and then retrieve that JSON asynchronously on the same page,pars it into a javascript object and display the username:message + date which are all coming from the database for a live public chat application?

  • @emajohnson4548
    @emajohnson4548 6 лет назад

    how the other thread is handled ,in a single threaded environment? i cant find any clear answer for that anywhere

  • @kylemurray3294
    @kylemurray3294 7 лет назад

    the ninja sounds spooked me

  • @Lwdw5000
    @Lwdw5000 7 лет назад

    Is it redundant to check readyState == 4 && status == 200? Could a status ever be 200 if the request was not completed?

  • @RaajKanchan
    @RaajKanchan 7 лет назад

    Hi Shaun, I do get the XMLHttpRequest details in console but couldn't get it's response. It comes blank by the way. Please help

  • @jakemeyers5430
    @jakemeyers5430 4 года назад

    After I add the JSON.parse, before http.response, my console says "JSON Parse error: Unterminated string". Does anyone know how to fix this?

  • @abubakaryousaf5562
    @abubakaryousaf5562 5 лет назад

    hello... can you please help me out that why this error is comming to me
    "Access to XMLHttpRequest at 'file:///E:/web/practice/js/data/tweets.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https."

  • @ChengChiMan
    @ChengChiMan 6 лет назад

    What is the difference between .response vs .responseText??

  • @evenaicantfigurethisout
    @evenaicantfigurethisout 5 лет назад

    If I wanted to display an EDIT form and a POST request on that form without page reload, is it doable using Ajax+Mongoose?