html5

How do i get a verified location using HTML5?

I've been playing with HTML5 location lookups recently and its relatively straightforward to pull someones location from a device like an iPhone. I want to write an app that uses location data, but its important that the location be factual. In other words I need to prevent people from authoring a fake post to the backing website / web...

Using html5 video events on the iPhone, how do I tell "Done" button click from a simple pause?

I've got a web page for the iPhone that uses the HTML5 video tags. On the iPhone, such embedded videos are played in the native player. I wanted to notice when the video had ended and when the user had dismissed the video with the "Done" button. Initially, I tried this: var video = $("#someVideo").get(0); vi...

:last-child issue when adding a footer after a section

Right, so this is strange. This code works as expected: HTML: <section> Section #1 </section> <section> Section #2 </section> <section> Section #3 </section> CSS: section{ margin-right: 30px; } section:last-child{ margin-right: 0; } The first two sections get a right margin of 30px, while the third section doesn...

HTML5 Canvas Question

I have a Sketching app done in all HTML5 and Javascript, and I was wondering how I would create an Undo Button, so you could undo the last thing you drew. Any idea? Thanks! ...

clearRect question in Canvas

I am looking to create an Eraser for a drawing app in Canvas, and I have this code canvas.clearRect(x, y, width, height); How would i implement it? ...

How to assign gradient fill to SVG shape via JavaScript?

Hi, I'm creating an SVG rectangle using the Raphael JavaScript library, and assigning it a fill using the following line of code: this.myBox.attr({fill: 'white'}); This works fine. However, now I want to tie this to a linear gradient. I have borrowed some gradient code to test it out, using the code below: <defs> <linearGradient id=...

what audio formats are supported by the android browser?

What audio formats can be played using the html5 'audio' tag in the android browser? Does anyone know where to find official specs on what the android browser supports and not? For the record, the android media formats page does not seem to cover this - I have soundfiles (3gp) playing fine in a native app, but they won't play in my weba...

Dynamically added AJAX content with wrong markup

i am using jQuery to dynamically add content $("#articles").prepend('<article><header><p>info</p><h2>You are using Internet Explorer</h2></header><p>It is recommended that you use a modern browser like Firefox, Chrome or install Google Chrome Frame to experience better performance and advanced HTML5 and CSS3 features.</p></article>'); ...

Any (or best) way to share data between desktop and browser/webapp?

I am looking for a way to let the user expose some local data to an webapp. The idea is to have a webapplication that goes somethings (e.g. plots a chart, edits photos, etc...) using information directly from the desktop instead of requiring the user to upload the data. While some of it might be possible with some technologies like Flas...

HTML5/H.264 format for desktop sharing

I am trying to live stream my desktop over http to one or more users. The immediate goal is just to share the desktop in real time in read only mode for several users. In future we might allow the users to control the desktop as well by mouse or keyboard. I have these queries in this context- Is HTML5 + H.264 right for this or do I ne...

Should I write Polyglot HTML5 documents?

I've been considering converting my current HTML5 documents to polyglot HTML5 ones. I figure that even if they only ever get served as text/html, the extra checks of writing it XML would help to keep my coding habits tidy and valid. Is there anything particularly thrilling in the HTML5-only space that would make this an unwise choice? ...

Using WebSocket with Flash?

I found web-socket-js for running WebSocket in Flash. If I run WebSocket under Flash, can all browsers with Flash player installed support this? ...

Resize a Flash object via jQuery onload of page

Hi. I'm using the HTML5 JW Player. It sizes the HTML5 video correctly, but shrinks the Flash fallback player; here's an example page: Test Page If you view that page in IE, you'll notice that on panel 5, the video is smaller than the space it's supposed to occupy. On Firefox, it works fine because it's using the OGG video in its HTML5 v...

Is there any way to embed a pdf file into an html5 page?

I want to have a web page coded with HTML5, and I want to be able to put a pdf file onto this page so you can view it without having to click on any links to download it separately. Anyone know how to do this? I want it to keep the text, images, and layout of the pdf file also. If that weren't the case I would just use an image. Thanks! ...

can a webpage on a mobile browser ask/get users location from the phone?

Is there any way that a webpage can make a request for the users location from the android / iphone device ? Since all I need is the users location, I am trying to figure out if there is anyway I can bypass developing a native app and use some nifty html5 call to just get the users location so all a user would need to do is visit my web...

How to set color to Rectangle drawn with html5?

I'm learning about Html5. <html> <body> <canvas id="canvas1" width="300" height="200"></canvas> <script> var canvas = document.getElementById("canvas1"); var cxt = canvas.getContext("2d"); context.fillRect(0, 0, 150, 100); </script> </body> </html> How to set color for this Rectangle? ...

ffmpeg settings for converting to mp4 and ogg for HTML5 video

Despite all the hype, in reality the HTML5 video tag has a bit of a problem. In order to use it and for it to be cross browser compatible, you have to include more than one format of the video. To target all supported browsers these formats are mp4 and ogg. I was searching around for optimum settings for each format but unfortunately I...

How can you create a local JavaScript database tied to a Safari-5 extension?

I was playing around trying to create a small safari extension, most for the fun of it and to see what you could do etc. Anyways I was thinking about storing some data for my extension in a local database, so I always would have it where I needed it, across page loads. I searched a bit on google and found this snippet from the Safari R...

Reading info from sqlite database, Syntax? How do I use it in html5 webapp?

I have a webapp that I'm building, and have just started with SQLite. I have been able to create my form, open the database I created, create the table, and fields i need, and enter data into the fields. Now I'm trying to read the data back out with a SELECT statement, to show it on screen and as a list of the columns. I just don't ...

WebSocket Events Not Firing

I'm trying to create a simple WebSocket example using the HTML5/JS API. Based on what I trace out on the server, it seems like the socket is connecting, but none of the events fire (onopen, onmessage, onclose, etc). I'm a Flash developer so I'm not very good at debugging the JavaScript and I'm hoping someone can help me out. Here's the c...