Categories
Javascript

async vs defer attributes in javaScript

In JavaScript scripting language, the async and defer attributes have a great support. So, let’s see how these attributes works. So, first of all we need to know how script works without any attributes. At first, the HTML file is parsed until the script file comes. Then, parsing stops and fetches the file and script […]

Categories
Javascript

JavaScript performance boosting tips

Client side java Script can make your application more dynamic and active. Let’s see some performance tips that will make your JavaScript fly. Basically, the browser’s interpretation of a code can itself introduce inefficiencies. So, the performance of different constructs may varies from client to client. Below tips can make a best practices to optimize […]

Categories
jQuery

Download a HTML content as pdf using javascript – jsPDF

Using jsPDF library, you can download the div containing graphs, tables, contents as a PDF. This is a HTML5 client-side solution for generating PDFs. Simply include library in your <head>, generate your PDF using the many built-in functions, then create a button to trigger the download. <script type=”text/javascript” src=”http://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js”></script> Create a object: var doc = […]

Categories
Javascript

Difference between call and apply in JavaScript

One of the very common thing which confuse you while writing JavaScript is knowing when to use “call” and when to use “apply”. Let’s look at following example: var person1 = {name: ‘John’, age: 52, size: ‘2X’}; var person2 = {name: ‘Jane’, age: 26, size: ‘5X’}; var sayHello = function(){ alert(‘Hello, ‘ + this.name); }; […]

Categories
API

Google Charts – visualize data on your website

Google charts provides a better way to visualize website data on your website. The chart gallery provides a very large number of ready to use chart types from simple line charts to hierarchical tree maps. To integrate Google Charts you need to embed JavaScript in your webpage. The process is very simple. Just load Google […]

Categories
jQuery

jQuery Cookie (Set, Get and Delete)

Cookies are the most important thing or technology for storing data on the client side environment. jQuery Cookie is a simple, lightweight plugin for writing, reading and deleting cookies from client side. At first you need to download jquery.cookie plugin and simply need to add it in your pages. <head> <script src=”js/jquery.js”></script> <script src=”js/jquery.cookie.js”></script> </head> […]

Categories
jQuery

jQuery fullscreen gallery with flip thumbnail

Using jQuery fullscreen gallery you can show full screen image with thumbnail view and flips when navigating through the next images. You can control the navigation with mouse wheel or keys and the big image will slide up or down. You can also zoom the thumbnail and resized image can be fit into the page. […]

Categories
Javascript

JavaScript onerror() method to handle error

The JavaScript onerror method is the first thing to handle error in JavaScript. This error event is called on the window object whenever any exception occurs on the page. There are three pieces of information to identify the exact error: Error message URL, in which file the error occurred The line number in the given […]

Categories
Javascript

How to associate functions with objects using JavaScript?

In JavaScript you can associate functions with objects. Here we will demonstrate how the constructor creates the object and assigns properties. Object is a standalone entity, with properties and type in JavaScript. JavaScript objects can have properties, that define their characteristics. Objects and properties: An object in JavaScript has properties associated with this. So, a […]

Categories
jQuery

idTabs – jQuery Plugin

idTabs is a jQuery plugin which adds multiple tabs into a website in a simple and easy way. It has endless possiblities. Using idTabs is very easy. Just download the library and copy and paste the following code into the <head> <script type=”text/javascript” src=”jquery.idTabs.min.js”></script> Now use the following scripts: <ul class=”idTabs”> <li><a href=”#tab-1″>Tab 1</a></li> <li><a […]