Using jQuery to Update HTML Without Refresh (Part 2 of 2)

  Рет қаралды 17,077

Pretty Printed

Pretty Printed

Күн бұрын

Пікірлер: 34
@DarkzSitesCompanyKz
@DarkzSitesCompanyKz 7 жыл бұрын
I love when you upload a new video! New things to do on flask projects! Thanks man.
@prettyprinted
@prettyprinted 7 жыл бұрын
You're welcome!
@patrickwellborn6252
@patrickwellborn6252 Жыл бұрын
Yes!! Thank you!!! I spent so long trying to find out how to do this...Your explanations were excellent and helped me extend the lesson to my application. Have a great day!
@a.d2761
@a.d2761 Жыл бұрын
You're a life saviour.
@alyahya
@alyahya 5 жыл бұрын
Thanks. Can you reload your code again? because your URL doesn't work.
@mustaphab32
@mustaphab32 4 жыл бұрын
yeah it doesnt
@-0-__-0-
@-0-__-0- 2 жыл бұрын
A good advice though, for beginners who decided to move sending form data using flask to sending form data using ajax, don't forget to remove method and action inside your form or your ajax call wont work.
@jamespaulchibole266
@jamespaulchibole266 Жыл бұрын
Thanks a lot Anthony for the wonderful video. I am updating a list within a page that is generated using a for loop and has flask pagination. What modifications do I need from what you have explained about refreshing to the next page number of items in the list without refreshing the entire html page?
@keennroechenfroilan3219
@keennroechenfroilan3219 Жыл бұрын
Thank you so much bro. Your videos helped me a lot!
@thisisstan5405
@thisisstan5405 3 жыл бұрын
Hi Anthony, Came across this vid while trying to figure out how to POST via jquery. This tutorial was very helpful in starting me off and is still relevant in 2021! Currently trying to figure out how to await properly (my server calls an API ). This seems to cause my template to be returned before the variables are set. I believe JQuery promises are the way to this, but I'm still unclear. Regarding your tutorial, I tested your code and would like to suggest some improvements: * Change SQLAlchemy's database URI to app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db'. Your current code uses absolute path, which is why I assume some can't get your code to work. * Why not encapsulate the controls in a form? That way you could use onsubmit() and account for carriage return. * Fetch resources from google's hosted libraries developers.google.com/speed/libraries. I tried to update bootstrap's version as well, but I guess those introduce some design-breaking changes, and I really don't want to fiddle with CSS, * Currently your member id updates before the fadeout animation. I used a promise and chained it to .done() and did a fadein() after replacing the HTML. I'm a complete newbie to JQuery so please excuse my ignorance. I've made those suggestion changes on my end, so if you have a repo somewhere, I wouldn't mind opening a pull request. Once again, Thanks!
@jimitshah2118
@jimitshah2118 3 жыл бұрын
i have one index page that shows all data in table and table contains edit button when i click the button that id data toggle in form when i change data in form click on update button page refresh but i don't want update that page so what is ajax for this ??
@ip-l934
@ip-l934 7 жыл бұрын
This is great! Looking how to tweak this to check for updates on a db, instead of continuosly refresh the page! You have a new subscriber here!
@prettyprinted
@prettyprinted 7 жыл бұрын
Thanks for watching and subscribing! If you only want to update the page when the database has changed, you can check this on your backend and only return HTML if something has changed. If nothing has changed, don't send any HTML, and have this checked on your frontend.
@harrythuku628
@harrythuku628 4 жыл бұрын
Hello Anthony. Thank you for your videos. They have been really helpful in my learning path. I have a question though. Every time I load my page extending my base template, I get errors loading jquery. I would like help with that
@Daveit93
@Daveit93 7 жыл бұрын
Mentioned you to the author of sanic that you'll be doing a tutorial on Sanic. They are excited and we're growing quick. I'll be making a tutorial with Sanic. It is a realtime chatapp with language translation using deep learning with pytorch. But I'll post it later after you've upload a tutorial on the basic. I'm not good in teaching :)
@prettyprinted
@prettyprinted 7 жыл бұрын
That sounds great! You should probably start working on it now though because I don't know when I'll be able to make the Sanic tutorial.
@pauldriscoll6319
@pauldriscoll6319 4 жыл бұрын
one question what is the advantage of html vs json update is there a preference and why and when would you use one vs the other ?
@prettyprinted
@prettyprinted 4 жыл бұрын
Sending html is more straightforward, but it's not as flexible as sending JSON.
@stevekim6923
@stevekim6923 4 жыл бұрын
Hello Anthony. Your video is the best I have ever seen. I am trying to modify your program by inserting live video stream in the index.html of the Part 1 of 2. The video stream is working just find; however, updating the individual field is not working. Live Streaming right below Members. Please help.
@olegsomov6635
@olegsomov6635 7 жыл бұрын
Hello, thank you for video, really helpful, I will try to update a table using this videos, hope it's gonna work). Question for you, what is the extension do you use in Mozilla, when you looking to the response? Thank you!
@prettyprinted
@prettyprinted 6 жыл бұрын
It's Firebug, but I don't believe it's under active development anymore because the standard developer tools do the same thing.
@andyb3854
@andyb3854 5 жыл бұрын
Hi Anthony, another great video! How would you modify this to handle adding new items to the database? I already have posting form data via ajax using your other video, just not sure how i would update the table on the page to show new entries without reloading
@andyb3854
@andyb3854 5 жыл бұрын
Hey Anthony, think i answered my own question. after my add route it redirects to another route which has a simple .all() query. The data is returned and i use .replaceWith in my jquery to replace the table with the new data. Does that sound sound correct?
@prettyprinted
@prettyprinted 5 жыл бұрын
@@andyb3854 Yeah, you can do that, but it may be cleaner all in one route instead of doing the redirect.
@jonathanbereyziat9380
@jonathanbereyziat9380 5 жыл бұрын
@@andyb3854 Hi how did you change the value of the table in the template with .replaceWith() I don't manage to understand
@ara7546
@ara7546 7 жыл бұрын
hey can you do jwt authentication exemple with flask-mysql ?
@prettyprinted
@prettyprinted 7 жыл бұрын
Yeah, I can add that to the list of videos I'm going to make. Thanks for the idea.
@ara7546
@ara7546 7 жыл бұрын
don't forget to do password resetting also, 2 factor authentification would be also great !
@prettyprinted
@prettyprinted 7 жыл бұрын
I'll add that to the list! Thanks.
@baxiry.
@baxiry. 7 жыл бұрын
Thank u very much
@prettyprinted
@prettyprinted 7 жыл бұрын
You're welcome. Thanks for watching!
@shango1964
@shango1964 7 жыл бұрын
How about a PJAX version?
@prettyprinted
@prettyprinted 7 жыл бұрын
I'm not familiar with PJAX, but once I learn it, I'll definitely make videos on it.
@genuinepshyco4050
@genuinepshyco4050 3 жыл бұрын
ok
The jQuery Hide, Show, and Toggle Functions
9:50
Pretty Printed
Рет қаралды 84 М.
React Node.js MySQL CRUD Tutorial for Beginners
46:27
Lama Dev
Рет қаралды 302 М.
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН
How to Deploy a Flask and Celery App to Render
14:38
Pretty Printed
Рет қаралды 4,2 М.
How to POST request in a Python Website using AJAX ? [Flask & Django]
22:07
jQuery with Flask - Flask Web Development with Python 32
17:18
The Biggest Mistake Beginners Make When Web Scraping
10:21
John Watson Rooney
Рет қаралды 114 М.
Submit AJAX Forms with jQuery and Flask
13:24
Pretty Printed
Рет қаралды 85 М.
Use Python To Import Data to Google Sheets
14:40
Daniel Otto
Рет қаралды 10 М.
JavaScript Tip: Accessing JSON Data
11:07
All Things JavaScript, LLC
Рет қаралды 53 М.
Using Flask-WTForms With Flask-Bootstrap
9:13
Pretty Printed
Рет қаралды 62 М.
Auto-Refresh Specific HTML Section: using jQuery
6:36
Technotip
Рет қаралды 141 М.