Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>XMLHttpRequest Test</title>
- <script>
- function sendRequest(url, method, async) {
- var xhr = new XMLHttpRequest();
- xhr.open(method, url, async);
- xhr.onload = function() {
- console.log('Response from CORS request ' + xhr.reponseText);
- };
- xhr.onerror = function() {
- console.log('Woops, there was an error making the request.');
- };
- xhr.send();
- }
- for(var i = 0; i < 25; i++) {
- sendRequest('https://cors-test.appspot.com/test', 'GET', false);
- }
- </script>
- </head>
- <body>
- <h1>Page Title</h1>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement