Difference Between Promises & Callbacks

Promises are not Callbacks. A Promise is a value which may be available in future or not. A Callback is a function which we call inside other function. Normally callback runs after the parent function completes its operation. Let’s say the function is sending AJAX query, we can use callback function in a way so, when the AJAX request gets response, we can use the response in the function to do some other operation. In case you are interested to

Continue Reading

Accessible HTML5 Video Player w/ Closed Caption (CC)

HTML 5 Video w/Closed Caption Thumbnail

To have HTML5 Video on page is good and to have it with Closed Caption is even better, as it will make video accessible for physically challenged as well. This post is in continuation of my earlier post on HTML5 Video. In this post I have covered one of the most important feature of videos, Closed Caption. I received a comment in my earlier post to include the closed caption feature in the script to make it more helpful. Please refer

Continue Reading

Introduction to Javascript Promises API

Javascript Promises API

A Promise is a value not necessarily known at the time of it’s creation. It mainly used in asynchronous actions resulting in success or failure. The Promises represents a value which may be available now, or in the future, or never. Promises new Promise(function(resolve, reject) { }).then(function() { }).catch(function() { }); then() and catch() are prototype methods and they can ben chained as shown above. A Promise will always be either “Pending” or “Fulfilled” or “Rejected”. Pending – Initial state, operation not

Continue Reading

Fully Customisable & Accessible HTML5 Video Player

HTML 5 Video Thumbnail

In modern browsers, with HTML5 Video Tag it is very easy and simple to include video in page. Unlike earlier we had to include Flash object and to support that we need to add Flash Player Plugin in browsers. Flash player was never bundled with Browsers so when we include flash object in our page we need to ask readers to install plugin first to see the video. HTML5 Video Video tag from HTML5 allows us to add Video on a page with

Continue Reading

Alternate Vanilla Javascript to use instead of jQuery

For quite a some time I was thinking to drop-out Javascript Libraries (like: jQuery, Yahoo User Interface(YUI), Alloy User Interface(AUI), MooTools…). But I was not sure that each browser supports the javascript code the same way or not. As we know that all browsers are interpreting the script slight differently. Particularly, I was not sure about IE8/ IE9 and js libraries were & are helping us to cop-up with these browsers. But now with latest IE & other browsers and with newer versions of

Continue Reading