Skip to content

Instantly share code, notes, and snippets.

View matt-west's full-sized avatar

Matt West matt-west

View GitHub Profile
@matt-west
matt-west / html-elements.json
Created February 10, 2014 09:39
HTML Elements (JSON)
[
"html",
"head",
"title",
"base",
"link",
"meta",
"style",
"script",
"noscript",
navigator.geolocation.getCurrentPosition(success, error, options);
navigator.geolocation.getCurrentPosition(function(position) {
// Get the positioning coordinates.
var lat = position.coords.latitude;
var lon = position.coords.longitude;
// Do something magical...
}, function() {
alert('Oops! An error occured.');
});
navigator.geolocation.watchPosition(success, error, options);
var options = {
enableHighAccuracy: true,
maximumAge : 60000,
timeout : 45000
};
<input type="text" x-webkit-speech>
var reader = new FileReader();
reader.onload = function(e) {
var text = reader.result;
}
reader.readAsText(file, encoding);
var reader = new FileReader();
reader.onload = function(e) {
var dataURL = reader.result;
}
reader.readAsDataURL(file);
var reader = new FileReader();
reader.onload = function(e) {
var rawData = reader.result;
}
reader.readAsBinaryString(file);
reader.abort();