AJAX is use to communicate with the server and perform action like – database manipulation, file upload, etc. without the need to refresh whole page.
Dropzone library makes easier to implement file upload using drag and drop on the page.
After file uploading, it shows the preview of the file in the upload area.
All the thumbnails are removed when the webpage is get refreshed.
To recreate the thumbnails after page refresh needs to send AJAX request to get all files list for adding thumbnails while initializing Dropzone.
Auto-populating records based on the selection make easier to control the flow of inputs and the user is restricted on the selection.
Data is updated on dependent dropdown according to parent dropdown selection.
To send AJAX request in Vue.js I am using Axios package.
In this tutorial, I create 3 dependent dropdowns for the country, state, city and send AJAX request to load records whenever dropdown value changes with Vue.js and PHP.
AJAX makes easier to load records from MySQL database without reloading the whole page.
Handle AJAX request from the controller and database manipulation in the model.
In this tutorial, I show how you can fetch records from MySQL database with jQuery AJAX in Laravel.
It is easier to add to the page and it does not depend on any library like jQuery.
The file will upload to the server via AJAX.
In this tutorial, I show how you can use Dropzone library to upload the file in CodeIgniter.
jQuery UI sortable enable to reorder the HTML element by drag & drop.
This will use to allow the users to adjust the positions of images to display on the webpage.
In this tutorial, I show how you can save the sorted image list order in the MySQL database and read it.
AJAX pagination makes it easier to display the large list of records in multiple pages without refreshing the whole page when navigating.
While navigating pages if you refreshed the webpage then it will load record from 1st instead of page position before the refresh.
E.g. If you are on 5 page then it will again start from 1 when webpage reload.
To retain the position, I am using COOKIE to store the page number and use it after page successfully load to fetch records in CodeIgniter.
AJAX makes easier to perform operations without submitting the form like – fetch, insert, delete records from MySQL database, file uploading, etc.
Using AJAX in WordPress is a little different. Here, need to consider two things –
- AJAX sent URL should be
In this tutorial, I show how you can handle AJAX request in your WordPress theme.