How to fire AJAX Request on Regular Interval

There are many cases when require to update certain parts of the web page on a regular basis.

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

There are two ways to send AJAX request at a 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.

How to fire AJAX Request on Regular Interval

Read more

Sorting the Table by clicking Header with AJAX

With sorting the list it is easier for the user to locate items in a sorted list than unsorted. It rearranges the data in specific order (ascending or descending).

You can either use PHP or AJAX to get the sorted data.

I am using AJAX to sort the list in this tutorial.

In this tutorial, I am displaying the employee’s list and attach click event on the table column header. Whenever header gets clicked then send an AJAX request with column name to sort with.

Sorting the Table by clicking Header with AJAX

Read more

How to upload a file using Dropzone.js with PHP

In web development, file upload functionality is a common requirement for many applications. PHP offers multiple choices for file uploads, but among them, Dropzone.js is widely favored. This JavaScript library streamlines the file upload process and offers an interface that can be customized and easily used by users.

Dropzone.js can be used with or without jQuery in your project, and it does not have any additional library requirements. This library does not handle file uploads to your server directly. In this tutorial, PHP will be used for uploading.

File upload can be done by either dragging and dropping or by using the file chooser dialog that opens when the drag n’ drop widget is clicked. While uploading, Dropzone.js displays a progress bar, generates a thumbnail image, and provides file size preview after uploading.

How to upload a file using Dropzone.js with PHP

Read more

Dynamically show data in jQuery UI Tooltip using PHP

In the constantly e­volving world of web developme­nt, creating an immersive and e­ngaging user experie­nce is crucial. One way to achieve­ this is by utilizing tooltips – a powerful tool that provides additional context and information whe­n users interact with specific e­lements on a website­.

By combining jQuery UI Tooltip with PHP, you can create dynamic tooltips that seamle­ssly fetch and display data in real-time.

In this article­, readers will embark on a journe­y to explore the fusion of the­se technologies, discove­ring how interactive tooltips can captivate and inform use­rs while showcasing data in creative ways. So why wait? Le­t’s dive into the exciting world of dynamically showcasing data in jQue­ry UI using PHP!

Dynamically show data in jQuery UI Tooltip using PHP

Read more