JavaScript Libraries HTML5 Hello Class For this discussion
JavaScript Libraries & HTML5
Hello Class! For this discussion you can choose which question you respond to. Feel free to respond to both, however only one is required. Please respond to ONE of the following questions:
Question A
Discuss the good and the bad of JavaScript Libraries. In what circumstances would you use Libraries?
Question B
Identify and share Javascript APIs that are built into HTML5 which you would be more likely to use. Also, share the type of solutions you would use the APIs.
Solution
A) Good to use JavaScript Libraries :
Ease of use
This is pretty much the main advantage of using libraries, it is a lot more easy to use compared to standard javascript and other javascript libraries. Apart from simple syntax, it also requires much less lines of code to achieve the same feature in comparison.
Large library
Like JQuery enables you to perform hordes of functions in comparison to other Javascript libraries.
Strong opensource community. (Several jQuery plugins available)
Javascript libraries has a following that religiously devote their time to develop and enhance the functionality of libraries. Thus there are hundreds of prewritten plugins available for download to instantly speed up your development process. Another advantage behind this is the efficiency and security of the script.
Ajax support
javascript libraries lets you develop Ajax templates with ease, Ajax enables a sleeker interface where actions can be performed on pages without requiring the entire page to be reloaded.
Bad to use JavaScript Libraries : lets take an example of javascript library such as jquery to understand
Functionality maybe limited
While JQuery has an impressive library in terms of quantity, depending on how much customization you require on your website, functionality maybe limited thus using raw javascript maybe inevitable in some cases.
JQuery javascript file required
The file is required to run JQuery commands, while the size of this file is relatively small (25-100KB depending on server), it is still a strain on the client computer and maybe your web server as well if you intend to host the JQuery script on your own web server.
B) Javascript APIs that are built into HTML5 are following :
1. High Resolution Time API
The High Resolution Time API provides the current time in sub-millisecond resolution and such that it is not subject to system clock skew or adjustments.
It exposes only one method, that belongs to the window.performance object, called now(). It returns a DOMHighResTimeStamp representing the current time in milliseconds. The timestamp is very accurate, with precision to a thousandth of a millisecond, allowing for accurate tests of the performance of our code.
2. User Timing API
Another API created for testing the performance of our code is the User Timing API. With the High Resolution Time API, we can retrieve the current time in sub-millisecond resolution but it leaves us with the pain of introducing a bunch of variables in our code. The User Timing API solves this and other problems. It allows us to accurately measure and report the performance of a section of JavaScript code. It deals with two main concepts: mark and measure.
3. Navigation Timing API
Page load time is one of the most important aspects of the user experience. Unfortunately, troubleshooting a slow page load is not easy because there are many contributing factors. To help with this, in addition to the APIs considered above, the W3C have proposed the Navigation Timing API. This API offers detailed timing information throughout the page load process accessible through the timing property of the window.performance object.
4. Network Information API
Do you think we’re done with performance stuff? No way! Performance is one of most important concept to focus on today. Even Google has set performance as one of the main goals to achieve in 2014, according to Google Chrome programmer Eric Seidel.
Another API that deals with performance is the Network Information API. It helps you discover whether the user is on a metered connection, such as pay-as-you-go, and provides an estimate of bandwidth.
5. Vibration API
Another key concept that gets a lot of attention in our industry is user experience (UX). One of the APIs proposed that allows us to enhance this aspect of our websites is the Vibration API.
This API is designed to address use cases where touch-based feedback is required, and offers the ability to programmatically produce a vibration interacting with the mobile device’s built-in vibration hardware component. If such a component doesn’t exist, it does nothing.
7. Page Visibility API
The Page Visibility API enables us to determine the current visibility state of the page. What this means is that we’re able to detect if our page is in the background or minimized (i.e. it’s not the currently-focused window).
This capability can help us to develop powerful, yet CPU and bandwidth efficient web applications. In fact, we can slow down or even stop a CPU and/or bandwidth consuming process if we detect the user isn’t using the page.
8. Fullscreen API
The Fullscreen API provides a way to request fullscreen display from the user, and exit this mode when desired.

