This file contains 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
// | |
// httpRequest | |
// Make Cross Origin http requests for JSON data. | |
// The first path is url, the second is a callback, as a JSON object. | |
// If XHR CORS is not supported then JSONP is used. "&callback=" is appended to the request URL. | |
// @author Andrew Dodson | |
function httpRequest(url,callback){ | |
// IE10, FF, Chrome | |
if('withCredentials' in new XMLHttpRequest()){ |
This file contains 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
// window.saveAs | |
// Shims the saveAs method, using saveBlob in IE10. | |
// And for when Chrome and FireFox get round to implementing saveAs we have their vendor prefixes ready. | |
// But otherwise this creates a object URL resource and opens it on an anchor tag which contains the "download" attribute (Chrome) | |
// ... or opens it in a new tab (FireFox) | |
// @author Andrew Dodson | |
// @copyright MIT, BSD. Free to clone, modify and distribute for commercial and personal use. | |
window.saveAs || ( window.saveAs = (window.navigator.msSaveBlob ? function(b,n){ return window.navigator.msSaveBlob(b,n); } : false) || window.webkitSaveAs || window.mozSaveAs || window.msSaveAs || (function(){ |