How do you show a loader until AJAX response? HTML, CSS and JavaScript | Live AJAX loader Demo
When you call Ajax and you need to display loading image or loader then you must have to follow this blog. In this blog we will create live example to display loading image or loader when Ajax call is in progress. Enjoy!
Let’s start step by step to configure the code for ajax loader.
Step 1: Create one simple table like calendar_event_master and store some sample data which we will use for demo purpose.
Step 2: Now you need to create one simple HTML file.
In this file we have included some CSS and JavaScript library like jquery.min.js, bootstrap.min.js and bootstrap.min.css which is used for web designing and make it much easier to use JavaScript on your website.
We added some custom CSS class like .loader-div and .loader-img that will be helpful to display your loader image in center.
We create one button and set onclick method. In above code you can see we have declare onclick="display_data()" event. When you click on this button we call AJAX to get data from the database.
Inside display_data() function we have added below code to show loader while Ajax call in progress.
$(".loader-div").show(); // show loader
To hide loader you need to use below code.
$(".loader-div").hide(); // hide loader
Step 3: Finally, you need to create one PHP file like display_data.php to get data from the database.
In this file we have included one connection file database_connection.php that will be helpful to connect your database.
Once your database connected then you need to write one select query to retrieve data from the database. Finally, you need to send response with json_encode($data) and that data will be display on page.
Blog and source code link: https://shinerweb.com/how-to-display-loading-image-or-loader-when-ajax-call-is-in-progress/
0:00 Introduction
0:25 How image loader work.
1:00 Start coding
2:55 Include required library
5:40 Show and Hide Loader Logic
13:00 Recap
🔔 Subscribe for more YouTube videos.
https://youtube.com/shinerweb?sub_confirmation=1
//Recommended videos:
▶️ How to create cron job in codeigniter – https://youtu.be/Pgc2vzrlwok
▶️ How to create cron job in laravel – https://youtu.be/jlCWLlLYEDc
▶️ How to create web push notification for website – https://youtu.be/WFLak5gkIvY
▶️ how to fix http error 500 – https://youtu.be/NhqPimtlVBQ
▶️ Subdomain not working – https://youtu.be/sCCcJwN5Y2U
//Let’s Connect:
👉 Subscribe: (https://www.youtube.com/shinerweb)
👉 Twitter: (https://www.twitter.com/shiner_web/)
👉 Facebook: (https://www.facebook.com/shinerweb/)
👉 Instagram: (https://www.instagram.com/shinerweb_official/)
👉 Website/Blog: (https://www.shinerweb.com/)
//About us:
Here we’re providing technical solutions related website development and mobile app development. We are highly updating people using our channel with current affairs, social news, political news and with the new features of updated applications. Here you will get chance to connect yourself with digital world.
//Disclaimer:
Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide, I may receive a small commission. There is no additional charge to you! Thank you for supporting us so We can continue to provide you with free content each week!
#ajaxloader #ajax #loader #javascript #javascripttutorials #jquery
Видео How do you show a loader until AJAX response? HTML, CSS and JavaScript | Live AJAX loader Demo канала Shinerweb
Let’s start step by step to configure the code for ajax loader.
Step 1: Create one simple table like calendar_event_master and store some sample data which we will use for demo purpose.
Step 2: Now you need to create one simple HTML file.
In this file we have included some CSS and JavaScript library like jquery.min.js, bootstrap.min.js and bootstrap.min.css which is used for web designing and make it much easier to use JavaScript on your website.
We added some custom CSS class like .loader-div and .loader-img that will be helpful to display your loader image in center.
We create one button and set onclick method. In above code you can see we have declare onclick="display_data()" event. When you click on this button we call AJAX to get data from the database.
Inside display_data() function we have added below code to show loader while Ajax call in progress.
$(".loader-div").show(); // show loader
To hide loader you need to use below code.
$(".loader-div").hide(); // hide loader
Step 3: Finally, you need to create one PHP file like display_data.php to get data from the database.
In this file we have included one connection file database_connection.php that will be helpful to connect your database.
Once your database connected then you need to write one select query to retrieve data from the database. Finally, you need to send response with json_encode($data) and that data will be display on page.
Blog and source code link: https://shinerweb.com/how-to-display-loading-image-or-loader-when-ajax-call-is-in-progress/
0:00 Introduction
0:25 How image loader work.
1:00 Start coding
2:55 Include required library
5:40 Show and Hide Loader Logic
13:00 Recap
🔔 Subscribe for more YouTube videos.
https://youtube.com/shinerweb?sub_confirmation=1
//Recommended videos:
▶️ How to create cron job in codeigniter – https://youtu.be/Pgc2vzrlwok
▶️ How to create cron job in laravel – https://youtu.be/jlCWLlLYEDc
▶️ How to create web push notification for website – https://youtu.be/WFLak5gkIvY
▶️ how to fix http error 500 – https://youtu.be/NhqPimtlVBQ
▶️ Subdomain not working – https://youtu.be/sCCcJwN5Y2U
//Let’s Connect:
👉 Subscribe: (https://www.youtube.com/shinerweb)
👉 Twitter: (https://www.twitter.com/shiner_web/)
👉 Facebook: (https://www.facebook.com/shinerweb/)
👉 Instagram: (https://www.instagram.com/shinerweb_official/)
👉 Website/Blog: (https://www.shinerweb.com/)
//About us:
Here we’re providing technical solutions related website development and mobile app development. We are highly updating people using our channel with current affairs, social news, political news and with the new features of updated applications. Here you will get chance to connect yourself with digital world.
//Disclaimer:
Links included in this description might be affiliate links. If you purchase a product or service with the links that I provide, I may receive a small commission. There is no additional charge to you! Thank you for supporting us so We can continue to provide you with free content each week!
#ajaxloader #ajax #loader #javascript #javascripttutorials #jquery
Видео How do you show a loader until AJAX response? HTML, CSS and JavaScript | Live AJAX loader Demo канала Shinerweb
ajax loader ajax loader using jquery ajax loader jquery ajax loader codepen ajax loader example ajax loader on button click ajax loader spinner ajax loader not working ajax loader center screen ajax loading animation ajax loader before success display ajax loader before load data ajax load content ajax load data ajax load more elementor ajax load function ajax loader gif ajax loader generator ajax loader how to use ajax loader line ajax load more php
Комментарии отсутствуют
Информация о видео
15 октября 2022 г. 12:50:02
00:14:00
Другие видео канала