AJAX (Asynchronous JavaScript and XML) is a technique for sending requests to a server from a web page and updating part of the page with the response, without a full reload. The browser does this through the XMLHttpRequest object or the newer Fetch API, and the data exchanged is usually JSON or plain text rather than XML.
The posts here start with concept explainers on how AJAX works, its workflow, and its advantages and disadvantages, plus a short crash course on XMLHttpRequest. From there they move into practical builds: auto-refreshing a div every second with jQuery load() and setInterval(), live search with PHP and an XML data file, dependent country, state and city dropdowns in Laravel, table filters that update on change, and image upload and crop with the jQuery Croppie plugin in both plain PHP and Laravel. A jQuery overview covers the library many of these examples rely on.
The material suits PHP and Laravel developers adding dynamic behaviour to forms and pages, and front-end beginners who want to see asynchronous requests in working code. A set of 50 interview questions and answers helps with revision before JavaScript or full-stack interviews.
Start here
- What is Ajax and How it works? An Overview and Its Use Cases – Explains how XMLHttpRequest drives asynchronous requests, plus AJAX's main features and advantages.
- AJAX Crash Course – Quick hands-on look at fetching JSON or text without reloading the page.
- What is AJAX? What are its advantage and disadvantage ? – Weighs the benefits and drawbacks so you know when AJAX fits.
- What is Jquery and use cases of Jquery? – Covers the jQuery basics used in most of the AJAX examples here.
- How to do Auto Load and Refresh Div every Seconds with jQuery and Ajax with PHP Script. – Builds a live-updating div with jQuery, PHP and MySQL step by step.
- How to add live search functionality to your website? – Working live search example with sample HTML, PHP and XML files.
- How to show City List as per Country and State select in DropDown using AJAX in Laravel? Part-2 – Dependent dropdowns in Laravel, a common real-world AJAX pattern.
- <strong>Top 50 interview questions and answers for AJAX</strong> – 50 questions and answers for revising AJAX before an interview.
Latest AJAX articles
What is Ajax and use cases of Ajax?
What is Ajax? Ajax is a set of web development techniques that allows web pages to be updated asynchronously by exchanging small amounts of data with the…
What is Jquery and use cases of Jquery?
What is Jquery? Jquery is a fast and concise JavaScript library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. It…
What is Ajax and How it works? An Overview and Its Use Cases
What is Ajax? AJAX stands for Asynchronous JavaScript and XML.It is the use of the XMLHttpRequest object to communicate with servers. The Ajax was publicly used on 18 February 2005 by Jesse James…
What is AJAX? What are its advantage and disadvantage ?
What is AJAX? AJAX stands for Asynchronous JavaScript and XML. AJAX is a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML,…
Top 50 Ajax Interview Questions and Answers
This list is going to be help you in preparation of interviews as it is frequently asked questions. Let’s begin – What is Ajax? Ajax isn’t a…
Top 50 interview questions and answers for AJAX
The Asynchronous JavaScript and XML (Ajax) refer to a group of skills that are used to develop web applications. By uniting these technologies, web pages appear more…
Laravel – select dropdowns that filter results in a table ‘on change’
Hello, I am working on an application that is kind of an eCommerce application that have a table of product and I want to add a filter…
AJAX Crud with laravel 5.8
samMotoShare.in is your go-to platform for adventure and exploration. Rent premium bikes for epic journeys or simple scooters for your daily errands—all with the MotoShare.in advantage of…
Simple Ajax CRUD Application in Laravel
Step 1 – Create a fresh laravel projet First off all , create a project using following command given below – Change Directory to AjaxCrud folder Step…
How to Image Upload and Crop in Laravel with Ajax
In this tutorial, I am going to tell you how to image upload and crop in Laravel with Ajax. To crop the image using jQuery croppie plugin,…
Image Upload and Crop using PHP and jQuery
In this PHP tutorial, I am going to tell you how to crop an image using jQuery and upload the image via Ajax. Using the Croppie plugin…
How to do Auto Load and Refresh Div every Seconds with jQuery and Ajax with PHP Script.
In this tutorial we are going to learn how to do auto load and refresh div every second by using JQuery and Ajax method with PHP Script….
How to show City List as per Country and State select in DropDown using AJAX in Laravel? Part-2
How to use AJAX in DropDown in Laravel? Example as in Country, State, and City. To Click Part-1 of its first blog. Now, we’ll start the next…
How to show City List as per Country and State select in DropDown using AJAX in Laravel? Part-1
How to use AJAX in DropDown in Laravel? Example as in Country, State, and City. What is the DropDown? Create a dropdown box that appears when the…
Searching, Column Sorting with Pagination using Ajax in Laravel 5.5
Step 1 : Instal Laravel Application If you have not install Laravel application, then you have to open command prompt, and run composert command, and then after…
AJAX Crash Course
What is AJAX ? Asynchronous Javascript & XML Set of web technologies Send & receive data asynchronously Does not interfere with current web page JSON has replaced…
How to add live search functionality to your website?
With Php Custom Search, full-featured text search engine library written entirely in Php,javascript and xml. It is a technology suitable for nearly any application that requires full-text…
AJAX: frequently asked questions
Does AJAX still use XML?
Rarely. The name comes from XML, but most AJAX requests today send and receive JSON, and plain text or HTML fragments work too.
What is the difference between XMLHttpRequest and the Fetch API?
Both send asynchronous HTTP requests from the browser. XMLHttpRequest is the older event-based API, while fetch() is promise-based, so it's easier to use with async/await.
Do I need jQuery to use AJAX?
No. jQuery methods such as $.ajax() and load() make AJAX calls shorter to write, but plain JavaScript can make the same requests with XMLHttpRequest or fetch().
What are the main disadvantages of AJAX?
Content loaded with AJAX can be harder for search engines to index, browser history and the back button need extra handling, and the page depends on JavaScript being enabled.
