JavaScript APIs posts

How to chart your hours with APIs, JavaScript, and SVG

I log every minute I spend at a computer. Ever since I became a full-time freelancer, I’ve been tracking my time, assigning each moment of my day to a project and a sub-task. It all started from a desire to make the best possible return on my time. As a freelancer who charged hourly, each and every minute had a monetary value. I’ve since relaxed my approach, but some positive aspects of time-watching have stuck with me. The over-used Drucker quote goes something like “What’s measured improves”,...

How to use the Device Orientation API

Today we have mobile devices that come equipped with everything from cameras to geolocation, and we have little computers in our hands that can do pretty much anything we do with our desktop. One of the key APIs that functions with mobile devices is the Device Orientation API. The Device Orientation API helps us as developers detect the orientation of the user's screen and make the necessary changes to our layout. For example, on YouTube, if you are watching a video and you tilt your phone, the video goes...

How to enhance HTML5 gaming with the Gamepad API

One of the big obstacles in designing a game in HTML5 is that the popular gamepad hardware isn't available. Nobody wants to play a game with keyboard buttons, so the arrival of the Gamepad API brings us a lot closer to console-style gaming in the browser. Browser support ... At the time of writing, the only browsers that support the Gamepad API are Chrome and Firefox — the latest version of each working unprefixed. However, the more we use this API, the more browser manufacturers will support it, and as...

How to use the MediaRecorder API

We we first discovered that we could access a user's camera using Navigator.getUserMedia, we were all pretty amazed; but there's more… With the MediaRecorder API (MediaStream Recording) that's a construct inside Navigator.getUserMedia we can record media streams for the user's device and instantly use them in our app. Using the MediaRecorder API ... To use this API we need to have some recorded media to work with and for that we will use getUserMedia to get some. We simply create an if statement...

How to use the Notification API

We’re all used to browser notifications; we get them all the time on sites like Facebook and now, using the Notification API, we can actually push notifications to the desktop. Imagine a site performing a task whilst the user checks her email, she would still receive our completion notification on her desktop. Browser support ... At present, the Notification API is a working draft, so it’s not universally supported. However, it is supported by Chrome, Mozilla and Safari. Even more helpfully,...
Home CSS Deals DesignBombs HTML HTML5 JavaScript jQuery Miscellaneous Mobile MySQL News PHP Resources Security Snippet Tools Tutorial Web Development Web Services WordPress