Category: AJAX

There are many cases where we have required to update certain part of the web page on the regular basis.

For example – showing live cricket or football score, display latest news feeds,etc.

In this tutorial, I show How to use jQuery AJAX to implementing this.

There are two ways to send AJAX request on specified time –

  • By setInterval() and
  • By setTimeout() JavaScript functions.

Both do the same work but they are reliable for certain cases, which I discuss in this tutorial.

Read More How to fire AJAX Request on Regular Interval

AJAX Jquery PHP

We generally require sorting feature in the Table layout when there is many columns or lots of data.

In this tutorial, I show you How you can implement it using AJAX and PHP within your project.

In the demonstration, I am creating a table layout which shows the list of employees and adding click event in header column. Within click, calling a function in which passing column name as an argument and sending AJAX request.

Read More Sorting the Table by clicking Header with AJAX

AJAX Jquery PHP

AJAX Javascript Jquery PHP

In this tutorial, we learn How we can send a JavaScript Array in AJAX request as data.

If you have not used JavaScript Array in AJAX request before, then you may be sending values which are separated by the comma e.g, 1,2,3,4, …

When does it require ?

You want to send the group of related values to the AJAX e.g – transfer all checked checkboxes values.

Read More How to Send JavaScript Array to the AJAX using jQuery and PHP

AJAX Jquery PHP

In this tutorial, we learn how you can Return JSON response or data from AJAX request. We are using jQuery and PHP for implementing this.

What is JSON?

JSON stands for JavaScript Object Notation, it is a data interchange format which is also been used to passing data from the server.

It is best and effective way to return data when you want to return multiple values from AJAX request. We couldn’t directly return an array from AJAX, it must have converted in the valid format.

In this case, you can either use XML or JSON format. I generally prefer JSON, it very easy to use. I am already used in my some of the previous jQuery AJAX tutorials.

Read More Return JSON response from AJAX using jQuery and PHP

AJAX Jquery PHP

In this tutorial, I will show another type of pagination which has Load more button for loading new content.

This type of pagination you have seen on many websites or in mobiles apps.

When the users get clicks the load button, the next list of data is being fetched and append it to the last of existing structure.

What in the demonstration?

For demonstration, purpose I am showing the list of posts when all posts are being displayed on the web page then show the Hide button instead of Load more.

Hiding all posts except the first 3 posts when the hide button gets clicked.

Load more results with jQuery,AJAX, and PHP

Read More Load more results with jQuery,AJAX, and PHP

AJAX Jquery PHP

Drag and drop is a simple way to allow the users to upload their files by dropping to the container. Nowadays most websites allow uploading using both drag and drop and the file browse e.g. PushBullet, Facebook, SlideShare, etc.

I am using AJAX to save the file to the server which triggers when the file dropped on the target container.

In this tutorial, I show how you can implement the similar type of feature in your project and which show thumbnail when the file successfully uploaded.

Drag and drop file upload with jQuery and AJAX

Read More Drag and drop file upload with jQuery and AJAX

AJAX Jquery PHP

Like unlike functionality used in many websites to know the user response on their content or article.

In this tutorial, we are going to learn how to add like and unlike button within the post using jQuery, AJAX, and PHP.

What in the demonstration ?

I will show the list of posts within this posts they have like and unlike button. It also has a label which shows how many like and unlike get by a post. Whenever user clicked on a button the value of label gets changed.

Like unlike using AJAX, jQuery and PHP

Read More Like unlike using AJAX, jQuery and PHP

AJAX Jquery PHP

Autocomplete search element show suggestion based on user input e.g. listing all products which start with character ‘a’.

For implementing this in the program you need to send AJAX when a keyup event triggers on an input element.

What in the demonstration?

Show an input box for searching users and show the list of the result based on input. When the users select any of the items from the suggestion list then fetch details of the selected value and display it on the screen.

Make Autocomplete search with jQuery AJAX

Read More Make Autocomplete search with jQuery AJAX

AJAX Jquery PHP

Sometimes, we have a requirement to make another element dependent on another element selection.

For example, when you go for the Registration to the website when you select a country according to that State Dropdown is filled.

You can do this with only PHP but it required you to submit every time on selection.

This solves your problem but it is little frustrating because it submits every time even if the selection is right or wrong and this is not every user-friendly.

For making it better you can use AJAX with jQuery it loads new data and removes old one on each selection.

What in the Demonstration ?

Creating a Department drop-down list and based on the option selection show all existing users of that department on another Dropdown.

How to Auto populate dropdown with jQuery AJAX

Read More How to Auto populate dropdown with jQuery AJAX

AJAX Jquery PHP