How to send AJAX request from WordPress theme

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 admin-ajax.php.
  • wp_ajax action hooks.

In this tutorial, I show how you can handle AJAX request in your WordPress theme.

How to send AJAX request from WordPress theme

Read more

Check Username Availability with Vue.js and PHP

Live username availability checking on the registration page is the common feature on most websites.

This will notify the user whether the username is already been taken or not before submitting it.

To do this require AJAX.

Send a request to check the username on the basis of response to perform the action.

In this tutorial, I show how you can check username availability using Vue.js and PHP while inputting.

Check Username Availability with Vue.js and PHP

Read more

Fetch records from MySQL Database with Vue.js and PHP

Data selection is one of the basic requirements when creating a dynamic website.

Mainly data is fetched from the database on page refresh but without page refresh require to send AJAX request.

I am using the Axios package to send the AJAX request.

In this tutorial, I show how you can fetch records from MySQL database using Vue.js and PHP with the Axios package.

Fetch records from MySQL Database with Vue.js and PHP

Read more