Author: <span class="vcard">Yogesh Singh</span>

There are many cases when require 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.

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.

How to fire AJAX Request on Regular Interval

AJAX How To JQuery PHP

Alert is one of the most used functions in the JavaScript. By this, we interact with users by showing information on the screen.

For example, use it in form validation for showing the warning on invalid input or using it to display the alert message when form successfully submitted. There are many other cases when you can use this.

But, the problem is it does not look good on the screen.

There are many free jQuery plugins that you can use to show the user-friendly message box.

In this tutorial, I am using sweetAlert jQuery plugin to show custom message box on the screen and use it as an alternative to default alert box.

It looks much better than default alert and it is responsive.

Create custom alert with sweetAlert jQuery plugin

JQuery

You generally display an error message while validating the form by using the alert or place message on <div> or <span> elements and show or hide them.

If you have a form which has many elements and you need to add Client-side Validation.

You are using the container to show the error messages in this case you need to create several container elements. It is a time-consuming process.

For making your validation process simpler there are many free jQuery plugins.

In this tutorial, I will explain you about Validation jQuery Plugin, using that you can define validation faster and systematic way.

It has the built-in method which you can use for validation and you can change the text of default error message.

You can also create your own method if you do not find any built-in method according to your requirement.

Add validation to the form with jQuery Validation Plugin

JQuery

With jQuery and javascript, it is possible to control the flow of the right click, cut, copy, and paste within the whole web page or from the particular section.

This type of functionality mainly found in the Test based web application where student not allowed to copy and paste content on the page.

Or displaying the custom context menu on right click.

Disable Right click and cut copy paste with jquery

JQuery

In WordPress Admin dashboard login form animate with shake effect whenever the user enters wrong details.

This can easily implement using jQuery UI library.

With jQuery UI you can shake an element in specific direction and distance.

Using this you can warn the user when invalid input is entered.

In the demonstration, I am creating a login form and which gets shake when wrong username and password entered.

How to Shake an element with jQuery UI

How To JQuery

Recent posts widget list your latest post and it helps you to keep reader longer in your site which reduces the bounce rate.

You can add it to anywhere within your site.

WordPress by default doesn’t show thumbnail in Recent posts Widget and if you want to add it you need to either modify the code or use Plugins.

With plugins, you can set your post featured image as the thumbnail or show any default image if there is no featured image and adjust its size.

In this article, I show you –

  • How you can add Recent Post Widget in the sidebar of the WordPress
  • And, add the thumbnail using Plugins.

Easily add Thumbnail to the Recent Posts - WordPress

How To

The phpMyAdmin allows us different ways to export the Table data. One of a method is CSV(Comma Separated Value).

There are two ways to create a CSV file with PHP –

  • By comma separated string, or
  • using fputcsv() method

I am using the fputcsv() method (writes an array to the file line by line) in the demonstration, where I am listing MySQL table data in the Tabular format and a button to export data.

When the export button gets clicked then creating a new CSV file and download it.

http://makitweb.com/how-to-export-mysql-table-data-as-csv-file-in-php/

DataBase PHP

Twitter only allows maximum 140 characters of a tweet. At the time of entering input, it shows how many characters are remaining.

Remaining character value changes on every character input.

Similar to Twitter other websites also uses the same functionality.

For example – In the medium, you could see this in Bio section there it allows 160 character input after that it didn’t take any inputs.

In this tutorial, I am creating the similar type of functionality with jQuery.

Twitter like remaining character count using jQuery

Javascript JQuery