jQuery Ajax Tutorial #1 - Using AJAX & API's (jQuery Tutorial #7)

Поделиться
HTML-код
  • Опубликовано: 17 июн 2014
  • Free RESTful API to use for practice!: rest.learncode.academy/
    In this jQuery AJAX Tutorial for beginners, we're going to be covering an introduction to using jQuery to access a JSON API (Application Programming Interface) to get data and populate it into the document. jQuery AJAX is powerful and is the first step to making dynamic websites that respond to the user actions as they happen. The first part of using jQuery AJAX to access a JSON API is to make a GET request, so this jQuery lesson covers how to make AJAX Get Requests with jQuery & JSON.
    Lesson #1: jQuery Tutorial for Beginners
    • jQuery Tutorial #1 - j...
    Lesson #2: Listen to user events and respond with jQuery actions!
    • jQuery Tutorial #2 - E...
    Lesson #3: Clean up the jQuery by putting some data in the HTML
    • jQuery Tutorial #3 - W...
    Lesson #4: "DOM Traversal" with jQuery
    • jQuery Tutorial #4 - D...
    Lesson #5: Building a jQuery Tab Panel Widget
    • jQuery Tutorial #5 - B...
    Lesson #6: Building a jQuery Slider / DOM Caching
    • jQuery Tutorial #6 - B...
    Lesson #8: Ajax Pt 2 - posting data to the backend
    • jQuery Ajax Tutorial #...
    ~-~~-~~~-~~-~
    Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
    • Responsive Design Tuto...
    ~-~~-~~~-~~-~
  • ХоббиХобби

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

  • @fiandrhi
    @fiandrhi 2 года назад +8

    I haven't done Ajax in 5 years, and I just needed a quick and dirty example to refresh my memory, and you're the only person who gave it. Thanks.

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

    This was exactly what I needed to understand how routing and RESTful APIs work. Thank you!

  • @suzyliu7335
    @suzyliu7335 5 лет назад +2

    This video is awesome! It helps me solving a problem that i've been stucked for many days

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

    0:32 He said, "Yippee" with no hesitation or sarcasm and I'm sold!

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

    Every single code you typed, you explained it very easy. Thank you!

  • @BEBE-nf9sf
    @BEBE-nf9sf 5 лет назад +16

    First, I've been following your video, and it's 2018. Great teaching. Thank you!
    For total beginners like me who are watching this video wonder about the backend file. To just first grab the concept of Ajax, we can skip the API part and just create a .json file and type in an array of object:
    so in the "orders.json" file we have:
    [
    {
    "id": 1,
    "name": "James",
    "drink": "Coffee"
    },
    {
    "id": 2,
    "name": "John",
    "drink": "Latter"
    }
    ]
    and in the main.js file we just adjust the pathname at the url: 'orders.json' the rest of the code the same. ;)

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

      For me that just leads to the following warning (and doesn't get the data):
      Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///. (Reason: CORS request not http).

  • @Straitoil
    @Straitoil 8 лет назад +12

    1:05 seconds in and I love you sir. Go on.

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

    These videos go dumb hard. I'm well on my way to doing good front end and back end web development. thank you for the indirect support. Imma mention this channel in my Nobel prize speech :) :) :) :)

  • @funkiekeda
    @funkiekeda 9 лет назад +3

    You're like super cool, man. Absolutely amazing tutorials with a great positive vibe to them. I wish I found this when I were learning the bases, I will make sure to recommend your stuff.

    • @learncodeacademy
      @learncodeacademy  9 лет назад +1

      Thanks! I appreciate it. Yeah, I'm doing these mostly, because I wish I had someone show me this stuff when I was starting out...would have saved YEARS.

  • @psyvegas7187
    @psyvegas7187 10 лет назад

    very clear and precise tutorial I've seen. thanks!

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

    Thanks this is the only tutorial that made sense and easy to follow thru. Cheers!

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

    I think I learned more in this video than I did in my entire semester in my databases class.

  • @rezafarzin
    @rezafarzin 10 лет назад

    A very clean and to the point tutorial

  • @arnity123
    @arnity123 9 лет назад +1

    You explained this so well. I have been struggling with ajax but now I really understand it with your video. Thanks!

  • @3xtraspicy
    @3xtraspicy 8 лет назад

    hey dude, your channel is pure awesomeness! really learned a lot from watching your videos

  • @AjaySharma-jv6qn
    @AjaySharma-jv6qn 4 года назад

    Excellent Approach of teaching - Sound, Speed, time taken to express Superb

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

    I'm working on a legacy JS project and this was very handy, thank you very much.

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

    Yours must be the only tutorial that I slow down instead of speeding up, because you don't talk a lot of s88t. And, thanks for that!

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

    Thanks man ! Best course on Ajax for me ;) Really helpful

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

    Thanks, these tutorials were pitch perfect for what I needed (a refresher after some years out of the web dev world). Cheers.

  • @NoahNobody
    @NoahNobody 9 лет назад

    Wow, you are a really good teacher. Subbed.

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

    You pretty tutorials really help me.
    Thank you.

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

    Thank you very much for the useful lecture!
    in case that API require an api key, where and how should I put the description of the key??

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

    Hi,
    Thanks for your great tutorials, could you suggest me where can I learn how can I connect my html file with my database ?

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

    Thank you for this awesome explanation!

  • @kevinmesto608
    @kevinmesto608 5 лет назад +8

    is there a link to the API you are using?

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

    most clear and understanding jQuery vid thanks. watching in 2020

  • @patrickmotard4048
    @patrickmotard4048 9 лет назад

    Thank you SO much for this tutorial. I had a hell of a time finding this online. Exactly what I needed. Well explained!!

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

    Just getting up to speed on all these technologies. Amazing. Thanks so much. Could you mention what tools and setup you're using? It looks like Visual Studio Code with a live page. What's the bottom right page? Is it the Browser 'Inspect Element'? Love to know your setup :)

  • @marduv
    @marduv 8 лет назад +29

    Bro, i loooove your video. Straight forward, easy to understand and the not saying any unnecessary info.

    • @learncodeacademy
      @learncodeacademy  8 лет назад +4

      +marduv Thanks a ton!

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

      +marduv Like, totally tubular brooooo! Surf's up duuuuude! Bogus!

  • @RemoteTactical
    @RemoteTactical 10 лет назад +3

    As quick as that was - it was easy to follow and I "got it" lol

  • @annu2022paulose
    @annu2022paulose 9 лет назад

    This video is an answer to my prayer!! thank you for explaining this in such a simple manner :)

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

    dude love your video. so easy to understand

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

    Thanks!
    GOD bless you and keep you :).

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

    Thanks for the course!

  • @polesetti
    @polesetti 9 лет назад

    very useful playlist, thank you

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

    Amazing tuto, thank you :)

  • @beatakozie7334
    @beatakozie7334 5 лет назад +2

    Could you make a video how to send one value to API and how does it look for both sides? I am really confused after these videos...

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

    Thank you for your great tutorials

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

    Really really great video, helped me a lot

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

    Thank you man, your content helped me a lot on understanding JQuery mecanics, hope you were my real life teacher :p

  • @AbstractAbsorption
    @AbstractAbsorption 10 лет назад

    Great tutorial, thanks.

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

    It's so clear. thanks

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

    Very useful! Thanks

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

    hi man i am new and i want to say something that i dont know a dam thing related to API so can you create toturial on XML or JSON whatever you use? Thankyou

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

    this video saved my day !!! :) thanks a lot
    @LearnCode.academy

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

    thanks so much helped me a lot

  • @Patrick-iy1rb
    @Patrick-iy1rb 7 лет назад

    Do you still need to call another script or link another specific jquery file especially for ajax or is it already included in the standard jquery script.

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

    thanks so much for this!

  • @learncodeacademy
    @learncodeacademy  10 лет назад +11

    Ajax Pt 2 releases Thursday @ 11am PST
    Ajax Pt 3 releases Friday @ 11am PST

    • @learncodeacademy
      @learncodeacademy  9 лет назад

      At the end of the day, you'll use get/post/put/delete methods to access services and get them to your application code. If it's a javascript app, you'll use javascript, if java, use java, etc. It's really about what program is needing to access the data. For anything HTML/CSS/JS webapp related, you'll just ajax requests and process them with javascript.

    • @learncodeacademy
      @learncodeacademy  9 лет назад +1

      does this help? stackoverflow.com/questions/4112686/how-to-use-servlets-and-ajax

    • @learncodeacademy
      @learncodeacademy  9 лет назад +1

      glad to help!

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

      +LearnCode.academy Your tutorial is amazing! BIG THANKS!

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

      Great to hear...thanks for the comment!

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

    This looks like a good tutorial, I plan to follow it more closely tonight. My concern right away is the use if IDs instead of classes. Any particular reason?

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

      +Daniel Cortes I used ID's since there are specific things I can count on: an orders UL, a name/drink input, etc. Classes work just as well if you can't guarantee these fields will be unique.

  • @VictorSanchezSS
    @VictorSanchezSS 9 лет назад

    Great video man, i'm wondering if you could do a tutorial based on Angular.js ajax, with the $http service, and also teach how to retrieve specifc data and not all of it! Thx!

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

    super bro,you can teach easy ,,thank you bro

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

    thanks for the tutorial good sir! but i do have a problem where the ajax is loaded but I can't seem to display the content even with console.log like you did. what did i do wrong here...??
    UPDATE: fixed! turns out i need to remove the comma on the json file lol silly me.

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

    When using the .each function, $(.streamsname).append vs $(.streamsname).html. when using the html it will output only one at the last of api. Is best practice to using the .append than .html?

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

    good video, very clear

  • @markgrover8184
    @markgrover8184 9 лет назад +1

    I learn more from books. Watching a series like this will take most of the same amount of time to read a complete book on the subject and learn in depth.
    Never mind the hundreds of tutorials that dont leave you like a fish out of water asking about API's and waiting for a response.

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

      +Mandar Ponkshe most definitely .
      I would urge you to learn with an open mind when reading it though. A would suggest the series call "You don't know JS" followed right after as these two will open up your mind to different ways to use JavaScript and introduce you to the most important pitfalls to be aware of. I find myself learning from chapters that introduce basics. Happy learning!

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

    very good video . Thanks a lot Bro

  • @igniculus_
    @igniculus_ 7 лет назад +13

    backend team provided you at api/orders what does that mean ?
    is there a json file in api/orders ?

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

    Is this Corey Schafer ? I can't forget your voice from amazing Python tutorials.

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

    What sublime color scheme are you using? Thanks for the tutorial!

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

      +Luis L. I'm using the Cyanide theme and the Cyanide/Monocyanide - Contrasted Semi scheme

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

    Great tut. Can you recommend a tut to show us how to set up our own restful api so we can use ajax to fetch json locally also?

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

    I don't understand how id does updated automatically when you make post request every-time, please explain it
    Thanks in advance.

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

    You are the best... I dont know how you do it, im mexican and i understanded it everything :)

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

      +oscar diaz hey, that is impressive (pats his own back). Glad to hear it helped, Oscar!

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

    This is exactly what I was looking for. Excellent instructional video!

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

    The api/orders returns a .json file right?

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

    FAN!
    very well explained.

  • @jeehooahn9114
    @jeehooahn9114 9 лет назад

    This presenter is so good

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

    How do you do that with the file bars? (larger)

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

    Great examples and walk through. Very helpful, thank you

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

    Best. Video. Ever.

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

    Dude, AWSOME !!!

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

    Thank you so much!!!!!

  • @anonymous-do5bs
    @anonymous-do5bs 7 лет назад

    basically, ajax will return stuff from a database. what else can it be used for?

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

    Awesome thanks alot

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

    where do you get the note from the backend team? please explain. video is a bit incomplete.

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

    Great video. One ques-- I want that when user puts new value in the "" box, i want to display the result into new html and not append the result into existing html and create long lists . How can i do that? Thanks in advance .. :)

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

      +Sumant Bagade instead of $someSelector.append(), just use $someSelector.html() to replace the contents.

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

    do you have more videos for ajax?

  • @carlosbenavides670
    @carlosbenavides670 9 лет назад

    Thanks for the vid (Y)

  • @MrProzbik
    @MrProzbik 9 лет назад

    can we use in this $each fn something like this =>, $orders += ' name: +..... '; will be it correct? or better use appendTO?

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

    Hey guys i'm confused by this one - is 'Orders' a separate file i need to create?

  • @Milchreiz
    @Milchreiz 10 лет назад

    thanks for the nice video tutorial. but one question, how does the backend work? what do you use therefor?

    • @learncodeacademy
      @learncodeacademy  10 лет назад +2

      Check out these tutorials on Node.js & Mongoose...they're not so much recorded for webdev beginners, but will give you an idea of how that goes down.
      Node.js tutorial for beginners 2014 - an introduction to Node.js with Express.js
      Node.js MongoDB Tutorial using Mongoose

    • @Milchreiz
      @Milchreiz 10 лет назад

      Cool. I will watch it. Thanks for the fast answer :)

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

    hahahah 0:58 you've killed me so funny , thx alot , thx a ton :)

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

    How can the program distinguishes between two "orders"? For one is a variable and one is an array?

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

    HI, I have followed the same but am getting Uncaught Type Error: cannot read property ''name' of null and in html page it is displaying name=undefined drink=undefined

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

    Good stuff :)

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

    How would you implement this with a SharePoint List, you are getting the list data with the REST but in the console log you get [object Object] > [function] [value] (value has my array of 78 items). I get this array that has two arrays and doing your example on my request gives me both arrays' information and I only want the second one, value?

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

    Hey guys. planing to work as a web developer. I know HTML5, CSS3 and now Im starting to learn JS. Should I focus mainly on jQuery? And what knowlage do I need to have in JS and jQuery to get a job? I dont have an idea how much do I need to learn.. Thx

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

      +EE Tech Learn JavaScript first and pick up jQuery if and when you need it. jQuery usage is going to continue to fall over the coming years as browsers are much easier to work with than they were a couple of years ago, mainly due to the death of IE < 11. Run through LearnCode.academy JS course especially when it comes to OOP and read JavaScript the good parts.

  • @RemoteTactical
    @RemoteTactical 10 лет назад +10

    Suggestion: video on creating APIs

    • @learncodeacademy
      @learncodeacademy  10 лет назад +3

      Yeah, I definitely want to add more node stuff. The express and mongoose videos are close, but they're more skimming the surface than really in-depth tutorials.

  • @jeromematthews392
    @jeromematthews392 10 лет назад +1

    Hi there, I saw the tutorial and thought it would be good to follow along with the code. Question: How would the viewer at home have access to the API data that you're referencing in the tutorial? I'm aiming to learn to build both the back and front end parts as a full stack developer so being exposed to that and being able to maybe build on it or play with it would be great since I'd like to code along with the demo.
    Is there a way for the viewers to access the data to follow along the series as well ?
    Thanks.

    • @learncodeacademy
      @learncodeacademy  10 лет назад +2

      I should put together a quick and dirty public rest api for users to access...great idea!

    • @jeromematthews392
      @jeromematthews392 10 лет назад +1

      Glad I could help!! :D
      I'll be waiting to see it!
      Hope its soon!
      Would be great if you could also explain the thought process and execution of that (restful API's), so we could learn to build our own restful api's, after learning about AJAX and JQUERY working together. I know I'm bewildered by the term.

    • @travisheller8003
      @travisheller8003 9 лет назад +1

      LearnCode.academy Did you ever end up doing this? adding a quick and dirty public rest api for users to access?

    • @learncodeacademy
      @learncodeacademy  9 лет назад +3

      Sure did! rest.learncode.academy/
      Here's a video on it: FREE REST API - Practice Developing Javascript AJAX Apps with this API

    • @jeromematthews392
      @jeromematthews392 9 лет назад

      Epic! Much Thanks for this Man!
      :D Been checking out your content.
      truly helpful stuff especially for beginner developers like myself! :)

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

    Thank You for the tutorial, cheers , but i have stack somewhere, Iam making an application where by my interest is to grab view by id, but when i tried using the same code on accessing id am getting an error data undefined, please any one with solution please help me, i am stack

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

    can you plz tell me abt ur localhost connectivity

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

    Hi, thanks for the tutorials!!!
    I didn't get why are you defining the i parameter in the second function if you are not using it
    Cheers from Tenerife!!

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

      +edumambo69 you have to define the first parameter in order to define the 2nd one. If you did success: function(order), then "order" would still have the value of i (the item's index)

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

      +LearnCode.academy Ok. Thanks for the response!! keep up the good work :)

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

    this is great.

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

    hi learncodeacademy,
    in this video u have used "order/api" as your url.. but i am confused about how to setup the backend for implementing ajax.
    please explain in detail about how to setup environment to implement ajax.

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

      +deepak kumar look into Express.js Here's 2 videos I have on Node.js backends:
      - ruclips.net/video/pU9Q6oiQNd0/видео.html
      - ruclips.net/video/FqMIyTH9wSg/видео.html
      Lumen (lumen.laravel.com) is another simple choice which will be PHP.

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

    Awesome thank you! Would you mind posting a video tutorial [Full project like a simple POS in a restaurant using mysql], that will help a lot to wrap up what we've learned from you,

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

    awesome nice tutorial

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

    thank u a lot!

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

    como eu acesso o (data) fora do escopo da função?

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

    YEAHHHHH ... LET S DO THIS