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
| const codes = [ | |
| { | |
| "status" : 400, | |
| "title" : "Bad Request", | |
| "message": "The request cannot be fulfilled due to bad syntax.", | |
| }, | |
| { | |
| "status" : 401, | |
| "title" : "Unauthorized", | |
| "message": "The request was a legal request, but requires user authentication.", |
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
| d3.select("#save").on("click", function(){ | |
| var html = d3.select("svg") | |
| .attr("version", 1.1) | |
| .attr("xmlns", "http://www.w3.org/2000/svg") | |
| .node().parentNode.innerHTML; | |
| //console.log(html); | |
| var imgsrc = 'data:image/svg+xml;base64,'+ btoa(html); | |
| var img = '<img src="'+imgsrc+'">'; | |
| d3.select("#svgdataurl").html(img); |
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
| [ | |
| {name: 'Afghanistan', code: 'AF'}, | |
| {name: 'Åland Islands', code: 'AX'}, | |
| {name: 'Albania', code: 'AL'}, | |
| {name: 'Algeria', code: 'DZ'}, | |
| {name: 'American Samoa', code: 'AS'}, | |
| {name: 'AndorrA', code: 'AD'}, | |
| {name: 'Angola', code: 'AO'}, | |
| {name: 'Anguilla', code: 'AI'}, | |
| {name: 'Antarctica', code: 'AQ'}, |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| </head> | |
| <body> | |
| <script id="whatever">document.write('<!'+'--')</script> | |
| <img src="filth.jpg" /> | |
| <!----> | |
| <script> | |
| // filth.jpg will start loading now for users without js. |
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 assets = [ | |
| 'http://localhost/offline-assets/fancybox/jquery.fancybox-1.3.4.js', | |
| 'http://localhost/offline-assets/fancybox/jquery.fancybox-1.3.4.css' | |
| ]; | |
| for (var i=0,l=assets.length; i<l; i++) { | |
| loadAsset(assets[i]); | |
| } | |
| function loadAsset(url){ |
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
| /*! | |
| * $.preload() function for jQuery – http://mths.be/preload | |
| * Preload images, CSS and JavaScript files without executing them | |
| * Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/ | |
| * Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/ | |
| * Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading. | |
| */ | |
| jQuery.preload = function(array) { | |
| var length = array.length, |