Last active
December 30, 2015 19:09
-
-
Save ChrisBuchholz/7872594 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 init = function () { | |
| var data1, data2, data3, data4, data5, data6, data7, data8, data9, data10; | |
| console.log('Start by waiting for a second...'); | |
| window.setTimeout(function() { | |
| console.log('Then send a GET request to a couple of websites'); | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data1 = data; | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data2 = data; | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data3 = data; | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data4 = data; | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data5 = data; | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data6 = data; | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data7 = data; | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data8 = data; | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data9 = data; | |
| $.get('https://cors-test.appspot.com/test', function (data) { | |
| data10 = data; | |
| console.log(data1); | |
| console.log(data2); | |
| console.log(data3); | |
| console.log(data4); | |
| console.log(data5); | |
| console.log(data6); | |
| console.log(data7); | |
| console.log(data8); | |
| console.log(data9); | |
| console.log(data10); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }); | |
| }, 1000); | |
| }; | |
| init(); |
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 init = sync(function* (resume) { | |
| var data1, data2, data3, data4, data5, data6, data7, data8, data9, data10; | |
| console.log('Start by waiting for a second...'); | |
| yield sleep(1000, resume); | |
| console.log('Then send a GET request to a couple of with XMLHttpRequest'); | |
| data1 = yield get('https://cors-test.appspot.com/test', resume); | |
| data2 = yield get('https://cors-test.appspot.com/test', resume); | |
| data3 = yield get('https://cors-test.appspot.com/test', resume); | |
| data4 = yield get('https://cors-test.appspot.com/test', resume); | |
| data5 = yield get('https://cors-test.appspot.com/test', resume); | |
| data6 = yield get('https://cors-test.appspot.com/test', resume); | |
| data7 = yield get('https://cors-test.appspot.com/test', resume); | |
| data8 = yield get('https://cors-test.appspot.com/test', resume); | |
| data9 = yield get('https://cors-test.appspot.com/test', resume); | |
| data10 = yield get('https://cors-test.appspot.com/test', resume); | |
| console.log(data1); | |
| console.log(data2); | |
| console.log(data3); | |
| console.log(data4); | |
| console.log(data5); | |
| console.log(data6); | |
| console.log(data7); | |
| console.log(data8); | |
| console.log(data9); | |
| console.log(data10); | |
| }); | |
| init(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment