Skip to content

Instantly share code, notes, and snippets.

View JonathanMatthey's full-sized avatar

Jonathan Matthey JonathanMatthey

View GitHub Profile
@JonathanMatthey
JonathanMatthey / scripted-objects1
Last active April 12, 2016 13:06
scripted-objects1
<!doctype html>
<html lang="en">
<head>
<title>Cars ex 1</title>
<script>
var cars ={
Beetle: {
color: "orange",
year: 2005
<!doctype html>
<html lang="en">
<head>
<title>Objects Ex 2</title>
<script>
var library = [
{
author: 'Bill Gates',
@JonathanMatthey
JonathanMatthey / gist:98597fb6d7a733b4236171bce6408e42
Created August 15, 2022 20:07
rainforestQA-follow function
var getJSON = function(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status === 200) {
callback(null, xhr.response);
} else {
callback(status, xhr.response);