How to POST request in a Python Website using AJAX ? [Flask & Django]

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

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

  • @rekabffej
    @rekabffej 9 месяцев назад +2

    Thanks so much! This really helped me with my CS50 final project!🦆

  • @jimshapedcoding
    @jimshapedcoding  2 года назад +5

    An update about where to get the code. I've initialized to migrate all my code snippets into one repository named codesnippets. Every copy&paste code snippet will be located there in the suitable directory as it is more manageable for me instead of locating them in my own website. Larger projects (i.e Minesweeper game) are exceptional, they will have their own repository links.
    Get the code from the Github link in the description and enjoy watching! :)

  • @hotcrossbun26
    @hotcrossbun26 Год назад +4

    Great video. Really clear and first time I really understood how to use this.

    • @mikelammi3088
      @mikelammi3088 Год назад +1

      Fully agree. Back to the basics is just what I needed.
      All I need to know now is, if I return some object back to the front end, how to display it without a refresh.

  • @rekabffej
    @rekabffej 9 месяцев назад

    Dude, I'm in CS50 working on my final project and I needed to learn how to use jQuery to do AJAX because what was taught in class wasn't sufficient for the AJAX that I want to do for my project. Your video helped me so much to understand how to do this! The way that you explained everything by going step by step and giving showing the results of your code at each step, then building on it just made it click. Thank you!!!

    • @rekabffej
      @rekabffej 9 месяцев назад

      Also, I'm not sure why but I noticed that you don't have a semicolon after your console.log statement. For some reason it still seems to work for me but I'm assuming there should be one.

    • @jimshapedcoding
      @jimshapedcoding  9 месяцев назад

      Hey, thanks for the warm words and the contribution, with 100% honesty, I want to say that it's ok to keep some lines without a semicolon. But not sure what are the rules in JS about it, I know that both cases are working.

    • @rekabffej
      @rekabffej 9 месяцев назад

      @@jimshapedcoding I'm not sure about the semicolon either since I'm pretty new to both coding and js but from what I'm seeing most of the time if you emit a semicolon in js it won't cause a bug, but in rare instances it will. I'm going to do my best to try to remember them just in case.

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

    This will help me in my blog app for quick liking and disliking a post : )
    Thanks Jim sir for this video

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

    Gained lot of knowledge from it.... your teaching style is Superb !

  • @Dziejkoo
    @Dziejkoo 9 месяцев назад

    Man you are amazing! Very clear explanation . Thank you

  • @MrSmart-tp8ko
    @MrSmart-tp8ko Год назад

    Lovely video, helped me finish my pet project 🎉❤🎉

  • @eldiablo922
    @eldiablo922 4 месяца назад

    u are the best

  • @Array-ce1fy
    @Array-ce1fy 4 месяца назад

    非常好的视频,爱来自中国😍

  • @tom.bailey
    @tom.bailey 2 года назад

    Nice video Jim, thanks!

  • @ButcherTTV
    @ButcherTTV 10 месяцев назад

    Good tutorial Jim!

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

    Sir thanks for the video 📹

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

    I watch most of the video but none of them is not working please... How to add a search system to flask app whereby if for example an admin search for something he can get the feedback

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

    i tried your way of specify URL for ajax. not working. I tries '/create_file', not working. I created a creatfile.py and use 'createfile.py' for ajax URL, not working. what is wrong

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

      Hey Yanhua, something must be configured maybe wrong. Let me help you in our Discord channel, you can join from this link: discord.gg/vcqK72aH

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

    Thanks! A very informative video as always! I'm curious about using AJAX outputs in conjunction with this. For example, after the user has entered something to the input and pressed a button, we can show the result on the page without refreshing. Is that even possible?

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

      Yes it is possible....There are videos on RUclips, try searching "Ajax Flask Form"

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

      Yes, sure it is possible, I want to believe that it's going to be the same as the example I showed here, only handling the response differently, and use a code snippet like:
      document.getElementById(''your_id').innerHTML = $YourNewValue

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

      @@jimshapedcoding Thanks!! I actually tried implementing this and it worked out pretty well!

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

    Nice. Could you do the same without Flask?

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

    how to fetch data from the back end after submitting a post request asynchronously in flask. please make a tutorial on that.

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

    Please and please I request from you to do a video on how to add a search 🔎 systems to the flask app but you didn't mind me up to now. But please help me 😢

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

    this is great, but I didn't see you implement anything on the client side without reloading the page.

    • @jimshapedcoding
      @jimshapedcoding  Год назад +1

      Hey Kavorka! Thanks for watching the tutorial. This was a basic overall explanation how to do it with a simple element. You can use the patterns of the single way I showed in this one and create much more client content that will reload without refresh.