Created
May 26, 2014 15:17
-
-
Save mgroves/43e04925cb084589ced5 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
| $(document).ready(function() { | |
| $.ajax({ | |
| type: "GET", | |
| url: "http://www.google.com", | |
| dataType: 'json', | |
| crossDomain: true // forcing a cross domain request for demonstration, you can omit this | |
| }) | |
| .done(function(content) { | |
| console.log(content); | |
| }); | |
| }); | |
| // should result in error message: | |
| // XMLHttpRequest cannot load http://www.google.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment