Tag: html5

please explain this requestAnimationFrame idiom

there are a lot of places (e.g. How to use requestAnimationFrame?) that fix window.requestAnimationFrame as below. I do not understand why the right hand side of the assignment is wrapped in to a function call. window.requestAnimFrame = (function(){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback){ window.setTimeout(callback, 1000 / 60); }; […]

Multiple html5 canvas elements: performance issue?

Regardless of the javascript, is there a performance problem when adding multiple html5 canvas elements for the purpose of displaying canvas made icon? I mean is there a difference performancewise between a div and canvas sematic element? I am trying to step away from images, svg and even fontawesome, thats why im asking.

Issue with the flash fallback of VideoJs with Firefox

I have try to add videoJs to my site to play MP4 files, all works perfectly in Chrome but when I go to Firefox (which doesn’t support MP4 files) the flash player stay on a black screen and buttons do nothing. Simple question: why? I don’t understand, websites like vine.co or instagram use videoJs with […]

MP4 in HTML5 Video Tag Not Playing in Internet Explorer

Can anybody tell me why this is working for Firefox and Chrome, but not for IE9, 10, or 11? It’s giving me the typical black screen with a small white square containing a red X. <!DOCTYPE html> <html> <head> <title>HTML5 Video Player Test</title> </head> <body> <video style=”position:fixed; top:0px; left:0px; height:100%; width:100%;” autoplay controls> <source src=”./videos/video.mp4″ […]

Swapping out images repeatedly at a high frame rate on iOS + Javascript?

Hey all what I am trying to implement is somethting where a user can slide a slider and update an image as the slider moves around. Sometimes the framerate will be ~30 fps. What I have tried: Use an img tag and set the src directly to the respective image. Use a single div and […]

In HTML5, how do I return the results of an SQLite call directly, rather than handing them to a function?

Using SQLite in HTML5, how do I execute a call such as the following so that it’s returned immediately, instead of passing off the result to another function? try { mydb.transaction( function(transaction) { transaction.executeSql( ‘SELECT name FROM celebs order by name limit 100 ‘, [], function(transaction, results) { // would like to return the “results” […]

Move cursor to next contentEditable – JQuery

what I am looking to do specifically is when i press enter it creates a new paragraph the cursor then moves to or selects the new content editable paragraph to begin typing but i cant seem to find a way to do it. /*HTML Layout*/ <div id=”wrap” contenteditable=”true”> || <—-cursor posiiton //*New paragraph content editable […]

Modern javascript design approaches to manage complexity?

I have a web app with a javascript code base that’s growing enough in size to where I’ve had to start re-evaluating how to best design this to manage the complexity. This has led me to a few questions on JavaScript design patterns: Are HTML5 data- or otherwise custom attributes a good idea? Might they […]

Good beginners tutorial to socket.io?

I am very new to the world of webdevelopment and jumped into the bandwagon because I find the concept of HTML5 very interesting. I am fairly confident on working with canvas and would now like to move over to websockets part of it. I have come to understand socket.io is by far the framework to […]

is there any way to stream binary content with javascript

I am hoping to make an example using the developer build of chrome and being able to use subsonic to stream a binary audio file. So far I have not had any luck though. Granted my next option will be try to load in the audio files into windowStorage and toss some magic dust on […]