Created
June 27, 2016 22:55
Revisions
-
steveharoz created this gist
Jun 27, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ Run this file on your local machine without a web server It should fail because (a) chrome doesn't allow requests on a local machine (b) submit.php doesn't exist (or shouldn't in this directory) But it claims to succeed! 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ <script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script> function callback() { console.log("SUCCESS... even though success is impossible because the file doesn't exist"); } d3.xhr('submit.php', 'application/x-www-form-urlencoded', callback) .header('content-type', 'application/x-www-form-urlencoded') .post('data=' + encodeURIComponent(JSON.stringify({hello: "world"}, null, " "))) .on('error', function (error) { console.log('ERROR: ' + error); }); </script>