From 67fdec20726e48ba3a934cb25bb30d47ec4a4f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20De=20La=20Pe=C3=B1a=20Smirnov?= Date: Wed, 29 Nov 2017 11:44:34 +0300 Subject: Initial commit, version 0.5.3 --- node_modules/xmlhttprequest-ssl/example/demo.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 node_modules/xmlhttprequest-ssl/example/demo.js (limited to 'node_modules/xmlhttprequest-ssl/example') diff --git a/node_modules/xmlhttprequest-ssl/example/demo.js b/node_modules/xmlhttprequest-ssl/example/demo.js new file mode 100644 index 0000000..4f333de --- /dev/null +++ b/node_modules/xmlhttprequest-ssl/example/demo.js @@ -0,0 +1,16 @@ +var sys = require('util'); +var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; + +var xhr = new XMLHttpRequest(); + +xhr.onreadystatechange = function() { + sys.puts("State: " + this.readyState); + + if (this.readyState == 4) { + sys.puts("Complete.\nBody length: " + this.responseText.length); + sys.puts("Body:\n" + this.responseText); + } +}; + +xhr.open("GET", "http://driverdan.com"); +xhr.send(); -- cgit v1.2.3