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>
Mee Mee Baby Liquid Detergent 1 L | pH Balanced, Free from Harsh Chemicals, Safe for Mother’s Hands & Baby’s Skin | Anti-Bacterial, Removes Stains & Odor with One Drop, Hypoallergenic | Mild Scent
₹229.00 (as of May 2, 2026 17:04 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.)rabitat Sip Around Stainless Steel Sipper 360ml | 2 Years Brand Warranty | Leak Proof | BPA Free | Sippy Cup for Kids with Soft Silicone Rim | Ergonomic Design, Sunny Roar
₹999.00 (as of May 2, 2026 17:04 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.)Portable Warmer Bottle,Travel-Friendly,Fast-Heating,Cordless And Rechargable,Precise Temperature Control,Long-Lasting healthy Warming for child safty,Comfortable Feeding Bottle For Home And Outdoor(bottle not included) (A-1) (A-1)
₹938.86 (as of May 2, 2026 17:04 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.)STOFFIER GARTEN Baby Teether Toy for 3+ Months, BPA-Free Food Grade Silicone Teething Ring, Soft Chew Toy for Teething Relief, Easy Grip Sensory Teether for Infants 6–12 Months, Newborn Baby Gift for Boys & Girls
₹199.00 (as of May 2, 2026 17:04 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.)Luxury Panda Style Baby Sleeping Bolster Pillow – 100% Breathable Cotton Support for Infants for New Parents & Nursery Decor
₹299.00 (as of May 2, 2026 17:04 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.)Amazon Brand - Supples Premium Baby Diaper Pants | 62 Baby Diapers | Large | 9-14 Kg | 12 Hrs Absorption | Cushiony Cotton Soft Fabric | Phthalates-Free | Triple Leak Guard
₹475.00 (as of May 2, 2026 17:04 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.)rabitat Gravity EasyFlow Stainless Steel Sippy Cup 390 ml | 2 Years Brand Warranty | Leak Proof | BPA Free Soft Silicone Straw | Sippy Cup for Kids with Weighted Straw, Sky Hoot
₹999.00 (as of May 2, 2026 17:04 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.)LuvLap Star Anti Spill Spout Sipper for Kids with Twin Handles, 270 ml, Sippy Cups with Soft Silicone Spout and Weighted Straw, Water Bottle for Kids, Non-Toxic & BPA Free (Pink)
Now retrieving the price.
(as of May 2, 2026 17:04 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.)