Makitweb Posts

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 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

Whether you are a beginner or not to the WordPress, you have seen the shake effect when you go for the Login in Admin Dashboard.

The login box shakes every time when the user enters the wrong username and password.

In this tutorial, I show How you can create the similar kind of effect using jQuery UI.

What in the demonstration?

For demonstration, I am creating two examples – In first, I am creating a basic Login form which shakes on the wrong username and password and in the second example, using the arguments with shake effect.

How to shake an element using jQuery UI

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 the number of ways to export the Table data one of the ways 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 downloading 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

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 the demonstration, 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

AJAX Jquery PHP

You generally write your article and publish its right off, or if you write more than 3,4 posts a Day in this case you either schedule them or save it to the Draft. And publish it on the right time.

Why not use those completed or scheduled posts to shows as upcoming posts on your website. This lets the visitors know What is now coming next.

For this, I am using a SOUP – Show off Upcoming Posts Plugin which lists your future posts on the website. It uses your scheduled posts for listing.

I am assuming that you have already scheduled some of the completed posts if you don’t know how to do it you can check my earlier post – How to Schedule Posts in WordPress without plugin.

How to show Upcoming Posts in WordPress

How To