What is AJAX?
(In simple AJAX is Load a remote page using an HTTP request.) |
Importance of AJAX?
- AJAX allows you to send only important information to the server not the entire page.
- Only valuable data from the client side is routed to the server side. It makes your application interactive and faster
Benefits of Ajax
There are 4 main benefits of using Ajax in web applications:
- Callbacks: Ajax is used to perform a callback, making a quick round trip to and from the server to retrieve and/or save data without posting the entire page back to the server
- Making Asynchronous Calls: Ajax allows you to make asynchronous calls to a web server. This allows the client browser to avoid waiting for all data to arrive before allowing the user to act once more.
- User-Friendly: Because a page postback is being eliminated, Ajax enabled applications will always be more responsive, faster and more user-friendly.
- Increased Speed: The main purpose of Ajax is to improve the speed, performance and usability of a web application. A great example of Ajax is the movie rating feature on Netflix. The user rates a movie and their personal rating for that movie will be saved to their database without waiting for the page to refresh or reload. These movie ratings are being saved to their database without posting the entire page back to the server.
Basic Structure of AJAX:
Here is the simple syntax to use this method −
$.ajax( options )
Example:
<html> <head> <title>The jQuery Example</title> <script type = "text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type = "text/javascript" language = "javascript"> $(document).ready(function() { $("#driver").click(function(event){ $.ajax( { url:'result.html', success:function(data) { $('#stage').html(data); } }); }); }); </script> </head> <body> <p>Click on the button to load result.html file:</p> <div id = "stage" style = "background-color:blue;"> STAGE </div> <input type = "button" id = "driver" value = "Load Data" /> </body> </html>
Little Rituals Mineral Baby & Kids SUNSCREEN Lotion Daily Use for Baby & Kids (0-15 years), SPF 40 PA+++ I No White Cast I UVA/UVB/IR + DIGITAL Wi-Fi & Bluelight Protection| Hypoallergenic| SWISS Technology | 75 gm
Now retrieving the price.
(as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Huggies Complete Comfort Wonder Pants | Pant Style Baby Diapers Newborn / XS Size, 90 pcs | India's Fastest Absorbing Diaper, Patented Dry Xpert Channel, Ideal for 0-5 Kgs, 1 count
₹576.00 (as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Pampers Active Baby Taped Diapers, Medium size diapers, (6-11kg) 90 count,taped style custom fit
₹1,396.00 (as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Little Angel Baby Easy Dry Diaper Pants With 12 Hrs Absorption Large Size, 9-14 Kgs - L (62 Pieces)
₹535.00 (as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Pampers Premium Care Pant Style Baby Diapers | Medium (M size) | 54 Count | Voted India's Softest | All-in-1 with 360 Cottony Softness Diapers | 7-12kg
₹971.00 (as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)TEDDYY Baby Easy Pant Diapers Medium 74 Count (Pack of 1), 7-12 kgs, 10 hrs Leak Protection, Anti - Bacterial
₹509.00 (as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Himalaya Gentle Baby Wipes | Buy 1 Get 1 Free |100% Biodegradable Plant-based fabric | Indian Lotus & Aloe Vera | Skin Friendly PH| Extra Soft
₹280.00 (as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)GITGRNTH Rechargeable Silicone Cloud Night Light for Kids | Color-Changing LED Changing Lamp |Adorable Room Decor & Gift for Toddlers, Teens, & Valentine's Day Present (Silicon Unicorn., Regular)
₹649.00 (as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)QIMIT Portable Automatic Milk Pump for Brestfeeding Breast Pump for Feeding Mothers Painless Breast Massage 3 Modes 9 Levels with Strong Suction BPA Free(XL-2401)
₹1,499.00 (as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)BELOXY Silicon Corner Protector for Sharp Edges, Table Corners Edge Protector for Kids, Bed Corners Edge Protector for Furniture, Baby Proofing Edge & Corner Guards (Transparent, Pack of 5)
Now retrieving the price.
(as of April 18, 2025 06:15 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)