Iterators in JavaScript PRO

JavaScript allows us to use iterators for going over the properties of a specific object or for going over the elements of a specific array. The following code sample shows how simple it is to use iterators in JavaScript. <!DOCTYPE html> <html> <head> <title>The Iterator Function</title> </head> <body> <script type=”text/javascript”> var student = { name: […]

MooTools Cookie Object PRO

MooTools provides us with Cookie, a global object that provides us with a clean and simple access to the cookies on our web browser. The following code sample shows how simple it is to create a new cookie and how simple it is to read the value of a cookie that already exists. <!DOCTYPE html> […]

MooTools Request Class PRO

The MooTools JavaScript library provides us with the Request class. This class wraps the XmlHttpRequest object and allows us implementing ajax in a much simpler way. The following code sample shows how simple it is to use the MooTools Request class. It includes two files. The first file is the HTML file that includes code […]

Math.js Jump Start PRO

Math.js is a lightweight open source JavaScript library that provides us with an extensive collection of mathematical useful functions. You can easily download the Math.js library code browsing in GitHub at https://github.com/josdejong/mathjs. The following code sample shows how simple it is to use this library. <!DOCTYPE html> <html> <head> <title>math.js demo</title> <script type=”text/javascript” src=”math.min.js”></script> </head> […]

String.js Jump Start PRO

String.js is a lightweight open source JavaScript library that provides us with useful functions for working with strings. You can easily download the String.js library code browsing in GitHub at https://github.com/jprichardson/string.js. The string.js library adds the S property to the window global object. The following code sample shows how simple it is to use this […]

Turn.js Digital Publishing PRO

Turn.js is a JavaScript library that allows us to create digital books the user can flip through their pages. Although the library is available as an open source project on GitHub there are some restrictions on using it. Make sure you check the license terms before you choose to use it. The following code sample […]

LESS.js Jump Start PRO

The LESS.js JavaScript library allows us to extend our CSS with dynamic behavior such as variables, mixins, operations and functions. The following code sample shows how simple it is to create new variables assigned with values so that we could reuse them in our code. The following is the LESS code. @myblue: #4C65BC; .stuff {color:@myblue} The […]

Video Capturing in HTML5 PRO

HTML5 allows us to capture the video and the audio stream coming from the device camera and microphone. The following code sample shows how simple it is to do it. <!DOCTYPE html> <html> <head> <title>sample for video capturing using html5</title> </head> <body> <video autoplay width=”480″ height=”360″></video> <input type=”button” id=”stopbt” value=”stop”/> <script type=”text/javascript”> window.URL = window.URL […]

Lambda Expressions in JavaScript PRO

The Harmony (EcmaScript 6) proposal includes the specification for arrow functions, AKA lambda expressions. Given this technology early stage you should check in advance whether the web browser you target supports it. The following code sample includes the definition for few arrow functions (lambda expressions). <!DOCTYPE html> <html> <head> <title>simple lambda expressions in javascript</title> </head> <body> […]

Google Charts Jump Start PRO

The Google Charts JavaScript library provides us with the capability to create various types of charts. The Google Charts library is available online hosted on Google servers. The following code sample shows how we can create a simple pie chart using the Google Charts JavaScript library. <html> <head> <script type=”text/javascript” src=”https://www.google.com/jsapi”></script> <script type=”text/javascript”> google.load(“visualization”, “1”, […]

Update cookies preferences