To Sort an Array Alphabetically, we have a sort() method in JavaScript arrays that sorts the array items into an alphabetical order. The sort() method accepts an optional argument as a function that compares two elements of the array. Following is the syntax of the sort() method: If we leave the compare function, then the sort() method will sort the array based on the array values. Following are the rules …
JavaScript Tutorials
Feedback with screenshot using feedback JS
In this tutorial I will explain how you can send feedback with screenshot using Feedback JS. This script allows you to create feedback form with screenshot with the form. Screenshot is based on the information available on the page. This script is based on html2canvas library, which renders the current page as a canvas image. As the whole image is created on the clients browser, it does not require any …
YouTube Video Information Using YouTube API
If you want to embed YouTube videos or want to add your video gallery then you can use YouTube API v2 to get all necessary information about the video like video title, description, category, thumbnail and others. In this post I am going to show you how to get YouTube video information using YouTube api. To get the YouTube video information in JSON format we will use CURL and pass …
Regular Expression With jQuery Validation
Regular expression offers an extremely flexible and powerful way of validation for website forms. Regular Expression with jQuery validation ensure you that provided user data is as per our requirements. In this tutorial I am describing some example Regular Expression with jQuery Validation. Regular Expression for Email: To validate the email address I have created a function based on standard regular expression which returns true or false. You just need …
Pure JavaScript Functions for Validation
In this article I am going to cover some JavaScript functions which are written in pure JavaScript. These function are used for validate the user’s input at client side. These are ready to use functions, so you can use them and save your time also you can modify these for your purpose. 1. To Get Only Numbers From User This function is very useful to get only numbers from the …
Get Flash Player Version with JavaScript
Sometimes we need to check which version of flash player a user has for something. For Example for a music website, I need to know the version of the flash player installed on the browser of the user to check whether flash song player will work on this browser or not. So to confirm this I have used a function getFlashVersion() to get Flash Player Version with JavaScript. The function …
How to Use Cookies in JavaScript
The HTTP protocol, which uses by Web Browser and Server to communicate, is a stateless protocol, means once the server send a response to a browser of the request, it doesn’t remember a thing about it. To solve this problem cookies were invented. There are other ways also to solve this but cookies are easy to use and very versatile. So in this article I will explain how to use …
List of Some important javascript functions
JavaScript is a lightweight, interpreted programming language with object-oriented capabilities that allows you to build interactivity into otherwise static HTML pages. We all know that today jQuery and Prototype are mostly uses JavaScript library. But we should know about standard JavaScript functions, So here I am listing some important JavaScript functions with their uses. split() : string.split(separator,limit); The split() method splits a string into an array of sub-strings and returns …