Skip to content

Instantly share code, notes, and snippets.

View pixiebox's full-sized avatar

Patrick Danhof pixiebox

View GitHub Profile
<a class="vimeo-lazy-link" data-height="349" data-width="620" data-video="3137949" href="http://vimeo.com/3137949"></a>
function fetchJSONFile(path, callback) {
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState === 4) {
if (httpRequest.status === 200) {
var data = JSON.parse(httpRequest.responseText);
if (callback) callback(data);
}