Created
July 14, 2015 19:14
-
-
Save gregglind/2da04930115fd03ffe93 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var URL = "https://geo.mozilla.org/country.json"; | |
var URL = "http://people.mozilla.org/~glind/"; | |
var myHeaders = new Headers(); | |
var myInit = { method: 'GET', | |
headers: myHeaders, | |
mode: 'cors', | |
cache: 'default' }; | |
var myRequest = new Request(URL,myInit); | |
var ohno = function () { console.log.call(null, arguments)}; | |
fetch(myRequest,myInit) | |
.then(function(response) { | |
console.log(response); | |
return response.blob(); | |
}, ohno) | |
.then(function(myBlob) { | |
//var objectURL = URL.createObjectURL(myBlob); | |
//myImage.src = objectURL; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment