jQuery Ajax Tutorial #2 - Posting data to backend (jQuery tutorial #8)

Поделиться
HTML-код
  • Опубликовано: 18 июн 2014
  • Free RESTful API to use for practice!: rest.learncode.academy/
    In this jQuery AJAX Tutorial for beginners, we're going to be adding new data to our backend server with the jQuery ajax post method. jQuery ajax post allows us to send data for the backend to save. When the backend is setup in a RESTful way, it will return our successful post along with an ID and any other information it created for us when it saved the information. We'll use this information to display our new post to our user.
    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 #7: JQuery Ajax tutorial #1
    • jQuery Ajax Tutorial #...
    ~-~~-~~~-~~-~
    Also watch: "Responsive Design Tutorial - Tips for making web sites look great on any device"
    • Responsive Design Tuto...
    ~-~~-~~~-~~-~
  • ХоббиХобби

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

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

    Thank you! This video is exactly what I was looking for, and the entire playlist has been great so far

  • @littlejssn
    @littlejssn 8 лет назад +13

    You are by far the most helpful, straightforward resource for web development on RUclips--perhaps the whole internet, even. Thanks for the info.

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

    These tutorials are so helpful! I had to dig through the comments to understand a couple concepts, but I have recreated this successfully :)

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

    I have learned more about jQuery thru your videos than anywhere else so far. Thank you so much!!

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

    Really great tutorial. it was 2 weeks i searched for this kinds of tutorial thank you Sir.

  • @coldsummersky69
    @coldsummersky69 8 лет назад +55

    This guy got a talent for teaching. Like if you agree

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

    Great videos! I have tried learning AJAX from a few other sites with little success. These videos taught me the basics in about 30 minutes. Nice!

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

      Yeah, they're not super complicated...you just have to know where to start with them - for most devs, the hindrance is that they don't have access to a backend and don't want to code one themselves for test.

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

    I really love the way the you say ha ha ha... :)
    I really became your Fan.

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

    Man you are amazing, you should teach web engineering in university ! Keep doing it like this !

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

    Great work, like how you explain the working.

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

    I like your energy!

  • @account-vj2tx
    @account-vj2tx 6 лет назад +1

    Parabéns! Congratulations! Assistindo em 2018 e funcionando!

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

    Thank you very much for the tutorial :) !!!

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

    that is an awesome explanation.

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

    This was helpful . Helped me in a project.

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

    man you made it so easy!!! wow

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

    Cooooool! I love jquery. Awesome!

  • @pradeepsingh-cg8iv
    @pradeepsingh-cg8iv 8 лет назад +1

    good one, I can implement jquery now

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

    Awesome tutorial!!

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

    Great tutorial !!

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

    Very helpful , Thank you !

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

    it is very helpful, thank you

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

    Is fantastic resource for beginners, thanks and look for React ;).

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

    I want to buy u a drink for this tutorial :) great work ...keep it up (Y)

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

    Good explanation, mate. :)

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

    awesome tutorial .!!!1

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

    Excellent article..thanks a lot :-)

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

    I've done it and its working! Thank you for this great lesson!

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

      How did you do that. I am getting undefined when I post to the json file. Pls help me

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

      Jeylani Osman
      post in all code so we could help you.

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

    AMAZING !

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

    thank you, nice explain

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

    Thanks for this tutorial. What if the data are coming from a MySQL database? I have found tutorials on how to convert MySQL to JSON data using php. But what if we are trying to write back to the database? Can I use what you have shown in this tutorial?

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

    This is pretty cool, do you have a video explaining how this order information is sent/received from the backend? Basically how the API writes and reads from the database?

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

    Спасибо тебе большое!

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

    Awesome

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

    which video in the jQuery series deals with caching the variable data? I already learned jQuery but for some reason this flew over my head.

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

    Very nice super

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

    Do you have a tutorial for the api in node.js? Also, will I be able to build my own api after taking your new node.js course? I am thinking about checking it out.

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

    I didn't know I need a backend program to save data, I thought I could save it in a json file, it spent me half day to figure out and another half to find out you got a backend program for using... Leaving this message to remind someone else about this: Don't try to save your data in json file, or you'll waste time haha!

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

    Correction: Both, GET and POST are sending data to the server. There is no other way to call a server's ressource as to send data - to begin with. The difference between the two is in which way the data is sent. While GET sends data as a component of a URL, POST sends it via standard input (i.e. the data is not visible in the URL string).

  • @jackhitchcock3980
    @jackhitchcock3980 4 года назад +2

    I'm struggling to link the API and draw the info from the it to the html file. Advice?

  • @francisngo
    @francisngo 7 лет назад +7

    when i post, i am getting undefined for both fields. no error message pop up. not sure what is wrong. i am using mamp to test.

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

      i'm gettting this too!
      5:47 the response i get is the json from orders, not the POST data that's being sent
      the data being passed through the function is different from the data: order from the variable

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

    Great videos dude! LOL I feel bad for the Hogan people. "Yes he's gonna use our....crap, oh man! :( " lol
    What did you do your backend with?

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

    Nice

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

    i dont get it :/ the data here is the same as in GET? i mean this is the data you got back or the data you sent to the server ? also , correct me if im wrong here but you didnt just got information that was already on a server. you modified the data / JSON file and got back the information from the same file. unlike GET ,when you only ask whats already there. correct ?

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

    Are you using any DB for this post call?

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

    hey boss! i think im almost ready to call myself a jr dev. i need help though!
    how do i learn how to create the api itself? secure it? i know the basics of the backend, but how can i make the both sides communicate and use logic from the back? creating the logic in the back??
    im so excited but i have so many unanswered questions that I can't seem to find good learning material for :[

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

    when you create the var order, who is who in name and name.val()?

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

    name: undefined, drink: undefined, new elements don't added. but new added

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

      and where is a server part? server must be write to the file?

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

      server it's localhost

  • @iabhishekpatil4415
    @iabhishekpatil4415 4 года назад +2

    where is the backend code? How it is storing the new data???

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

    In post success just call get method.. will work the same way.

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

    How exactly can i define the response in the backend?

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

    Are there tutorials on the backend as well? Wondering on how to setup the structure on the GET/POST on the backend.

  • @samia.delgado468
    @samia.delgado468 9 лет назад +1

    Hello!, thank you for the tutorials, they are great. I dont understand though that you dont use a json o php file, but a RESTful API...this one I dont understand well how it works, could you explain me about it please?

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

      ***** Sure. So in real life, you would use a url like:
      /api/drinks/order/13 (get all drinks for order # 13)
      A backend server is running in PHP, Ruby on Rails, Node.js, Java, etc.
      That server gets that URL, fetches all the orders from the database and returns them in JSON.
      Since we don't have a backend, an easy way to "fake" that GET request is to just get a .json file.
      Now, that's very limited, since we don't have the ability to write to files with javascript in the browser, so it's only good for GET requests.
      That's why I made rest.learncode.academy - to help you fake in a full backend to build your frontend code around.

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

    Did you just make newOrder a variable on the fly?

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

    From where I will get to learn the backend code for handling the request which are made in this video

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

    Great cast! was wondering if maybe you could also cover the best methods in implementing popular jQuery plugins into your project etc?

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

      Thanks! That would be good.
      I can say my recommended way would be:
      - use bower to install the plugin (if it exists as a bower package, unless, download manually)
      - use grunt-usemin (github.com/yeoman/grunt-usemin) to build 2 JS files for deployment - one for all library/plugin code, one for application code
      You can sort-of see this in action in the yeoman tutorial (YEOMAN TUTORIAL - Master Front-End Workflow with Yeoman, Grunt and Bower)

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

      LearnCode.academy Yes watched the video still a little confused on the concept of minifying css and js and how bower and jquery plugins differ from the other approach and work together.Will have to do a little more research for sure.

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

      Yeah, grunt is a lot to take in at first, because it can be used to do just one thing or 100 things.
      Bower is the simplest component...it gives you a way to search and download popular plugins from the terminal. That's pretty much it.
      The concept of minification is:
      The browser will have to make 10 get requests (hit the server 10 times) to get all 10 javascript files on our page...this is a lot of server load as traffic grows. Grunt can concatenate all of your javascript files (basically paste them all end-to-end into one file). Now, your server gets one request and delivers one file. Grunt can also minify it to cut the file size in half or more. Now your page loads faster.

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

    First, thank you for this. Some good learnings here. I'm getting 'undefined' while appending, but I'll try to figure it out.
    If I'm understanding this, when we're 'adding an order', it's only updating the cache, not actually writing to the JSON file, correct? When I refresh, only the JSON is loading, not the added orders.

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

      When you click the add order button you enter data and that data is shown. So when you refresh it no button has been clicked this time, that's why you can't see the order again. You should inspect element before and after clicking the button and check the ul tag. It's the html that get's updated. Also this data is stored in SQL server. Btw even i'm getting the same error "undefined" when i put an alert it shows "success" but it does not really have any object contained in it.

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

    so what does php do? i thought that was the backend GET thingy.

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

    I am wondering is the newOrder returned by the POST request?

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

    Cool

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

    I was so pissed off that you used the semi-colon on the order's object because I though I was the one wrong and that I had to relearn this new syntax for Ajax. and then you got the error, thank god

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

    Question :
    how is the object called 'newOrder' operating ?

  • @SivaKumar-mo9uj
    @SivaKumar-mo9uj 7 лет назад

    Example is with json data. Can you please explain with xml pay load and xml response data.

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

    People say that AJAX and jQuery are outdated! How would these results achieved without AJAX for example while using React or VUE ?

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

    Did you install this backend team file or somthing? Because i cannot access to localhost:3000/api/orders..

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

    Hi, would it be possible for some advice? I am currently working on a project and am wondering what my URL would be? I am runnig the client side via an http-server, and need it to post to my RESTful service which is on localhost with an endpoint called /insert. I am running my endpoint on localhost via node (so in console i write node api-sqlite.js). I use this to store the code to add data into the database. I am really confused as to what my URL would be. Would it be /insert or var url = 'localhost:3001/insert?callback=?';

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

    Thanx a lot! It's clear what this all about) Just one note: delete this terrible noise at the beggining)))

  • @Pyroo0
    @Pyroo0 9 лет назад +8

    when I click the button to post it will save the records in the database but when it appends the element it brings undefined, what am I doing wrong here :(

    • @piq-dg3vz
      @piq-dg3vz 8 лет назад +1

      +Pyroo0 use the api that he provided. rest.learncode.academy/api/learncode/friends

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

      +Pyroo0 try to use name.val() without $

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

      Ken Aguilar Thank you for help! But i've got one question. Why it's work on api, but not work on json local file?

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

      @@J4si3k1992 Probably you founf a solution for this challenge, but incase you didn't, here is a good place to start github.com/typicode/json-server . Just create fake REST API environment and use that for all operations in a local json file.

  • @jeyosman1
    @jeyosman1 9 лет назад +2

    Pls show us how to do simple backend example in the locahost so us to understand complete application

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

      Check out the node.js tutorials!
      ruclips.net/video/pU9Q6oiQNd0/видео.html

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

      +Jeylani Osman coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/

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

    how can I do it if I have multiple checkboxes and radio buttons?

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

    What's the difference between the $orders.append in GET and the one in POST?

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

    What is that color scheme and font in sublime text ?

  • @PradeepKumar-sx6ms
    @PradeepKumar-sx6ms 6 лет назад

    With the above fields name and drink i have to send file is it possible??

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

    I just get the "Blocked loading mixed active content" message.

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

    I dont get one thing, on refreshing page, why is the appended html still there?

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

    I want to see api/order url, because my POST request payload dose not contain id like: {name: "adsf", drink: "adf"}, and it doesn't save new order to json file. POST Method is success, but not save new order in json file.

  • @nissal7033
    @nissal7033 5 лет назад +3

    I'm getting this weird error when doing the POST with ajax to update the DB: POST 127.0.0.1:5500/jQuery/api/orders.JSON 405 (Method Not Allowed). Any advice?

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

      Nissal I had this issue with the DELETE method. How did you solve it?

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

      Nissal same bro,do u resolve it yet?if so,help me out plz.

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

    Why do you need to append the sent data to the site? Why cant just ajax refresh the connection, and send back the data??

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

    I seem to be getting the json data just fine, but I received a 404 error on click, even though it's the same file path. I set up an Express.js server for local host 3000 as well. Not sure what the problem is. I wish you would go into more detail on the back end api and json file. Thanks

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

      I have a Tutorial for node.js here: Node.js tutorial for beginners 2014 - an introduction to Node.js with Express.js that might be able to get you started. I have some upcoming lessons that cover node in more detail. Basically, in order to ajax to your node server you eitner a) need to be running your JS on a page served by the server. i.e. localhost:3000/index.html or b) you need to enable CORS on your express.js server to allow any domain to access the API with javascript. Here's how to do that: enable-cors.org/server_expressjs.html
      I hope that isn't too much detail for an answer. The backend does get a decent bit more involved sometimes.

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

    a short question:
    when ever you want a click on a button to execute a piece of code... couldnt u have used something like
    $("#add-order").click(function (){
    blah blah blah *code*
    });
    Wouldnt that be the same?

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

      +Rasmus Dyhr Yes U can use that ,This method is a shortcut for:
      .on(click,function()
      {
      Your blah blah blah code
      });

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

    if i use another url, method post is not allowed, i already use xampp, still not work.

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

    This video just helped me so much and put me tremendously ahead of where I was even a few hours ago. I have some additional questions regarding something I'm working on. Do you have an email address I can contact?

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

    It's not working for me.( Basically I just copied code from the video but it's not writing date in json file and give that variable undefined. What could be the reason? I checked some solution in stackoverflow, but neither of them work for me

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

      +Anna Presnyakova Watch KUDVENKAT series. For asp, ajax, js, jquery.. just aewsome....

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

      +Anna Presnyakova me as well. it's not writing into file. i already checked if i made some typo but everything seems fine to me and somehow it return undefined. please reply it you already figure it out.

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

      may i see your code? Mail me: mohak1990@gmail.com

    • @piq-dg3vz
      @piq-dg3vz 8 лет назад +1

      +Anna Presnyakova
      Use the api that he provided. rest.learncode.academy/api/learncode/friends

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

      +Anna Presnyakova same here I hope +LearnCode.academy has some idea about it pleaseeee!

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

    Great Tutorials! But if I want to POST to a JSON file in my pc (without using your api), what I need?

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

      The short answer: it can't be done without a backend like php, node.js, ruby on rails.
      GETing a file is doable, but you really shouldn't store changing data in a file, it should be in a database.
      Now, you CAN use a backend-as-a-service company like Parse, Backendless, Firebase...most of which have a free tier which has quite a lot of capability.

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

      So, if I make a POST to a php file that writes the information I send in a JSON file, is a bad practice?

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

      Yeah, I wouldn't recommend it. GETing a JSON file is usually used to temporarily mock in getting info from a database.
      Now, if your goal is to learn JS and you just need SOMETHING on the backend to update it, writing to a JSON file is fine.
      I'd install mysql on my machine or use a SQLite database file.

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

    Is there a tutorial on how our mate set up this backend? It would be amazing to understand the structure of the other side of this coin! Maybe we could find out why Bobby likes water ;-)

    • @AnhKim-sh5ef
      @AnhKim-sh5ef 8 лет назад

      learn PHP! you may need to learn mysql, JSON...

    • @AnhKim-sh5ef
      @AnhKim-sh5ef 8 лет назад

      +Anh Kim or there are some api ( Google drive api to save files online, pastebin)

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

    what about a token for the api ?

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

    hi,what if I want to determine what the button submits ,say I have 3 buttons with IDs fruit1,forwad and show ,when you click on fruit1 the infomation in show (an image and image name) must be put in the button with id "forwad" on the same page.
    I Tried this but can't get anything
    function myonclickfn(){
    document.getElementById('fruit1').onclick=function(){
    $.ajax({
    type: "POST",
    url: $("#forwad"),
    data: $("#show"),
    });
    };
    } ;

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

    just a noob question what is the meaning of $ before the "ajax" ??? before , my code looks like this "jQuery.ajax and then I changed it to $.ajax and still it's working. thanks for the info BTW.

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

      $.ajax would be the same as jQuery.ajax. It's just a shorthand thing for jQuery.

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

    Is there a proper link to the code, cause the URL doesn't seem to exist anymore.

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

    why I am having not url api/order found ?

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

    Can anyone knows how to send 4mb size of the data object to back end?

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

    LearnCode.academy why did you make a new variable newOrder?

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

    hey everyone, pls my mustache.js isnt working, however the project works but once i include the and add the template output in the main.js everything dies......pls help

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

    I do not understand the url you are using : /api/orders. Is orders directory or file like json . how the forward slash I mean directory structure. for me it does not fine the file I used api/orders.json GETworks but Post does not work

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

      This is a mock of a common pattern, where /api is a backend that the backend developers manage for you. I have a tool to help you play around without creating a backend: rest.learncode.academy

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

    I get an error when trying to post new data to the JSON file. Can someone help me?

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

    i get a return of undefined values

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

    Outstanding lesson !
    One thing I really hate about JS is how so often you see nested functions 3 levels deep and endless closures. I just do not understand how these work. Do you have a lesson which explains how all this works ? Thanks !!

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

    Hi! I tried following your tutorial and think I got the hang of it, I mean the list is populated when i POST. I am a complete newbie when it comes to ajax, I have learnt Html/css quite a bit but not so much javascript and jquery. My goal is to be able to understand how it all connects and maybe, in the future, be able to build a simple social media app.
    The strange thing with my .json file is when I type in the url in the browser the added items is shown together with id:s, but the id:s is very complex like: 55793aa3f263ac0100e70a4f.. not the correct 0, 1, 2 and so on.. Do you know what I did wrong without looking at my code?
    Thanks for a great channel!
    //erik

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

      Erik Sundqvist that's a normal id for a MongoDB database, which is what the ajax backend I built is on. MySQL databases, on the other hand, tend to start at 1 and go up from there...it all depends on the database, really.

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

      LearnCode.academy Thank you for your reply! Now I know why ;)

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

    How to create an api to store data in backend?

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

    how to add date in this?