Created
February 18, 2014 03:38
-
-
Save m-philipp/9064268 to your computer and use it in GitHub Desktop.
CORS Jquery Test
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>get demo</title> | |
| <style> | |
| span { | |
| color: red; | |
| } | |
| div { | |
| background: yellow; | |
| } | |
| </style> | |
| <script src="//code.jquery.com/jquery-1.10.2.js"></script> | |
| </head> | |
| <body> | |
| <script> | |
| // Assign handlers immediately after making the request, | |
| // and remember the jqXHR object for this request | |
| var jqxhr = $.ajax({ url: "http://www.api.lean2do.de/version", | |
| type: "GET", | |
| crossDomain: true}) | |
| .done(function() { | |
| alert( "success" ); | |
| }) | |
| .fail(function() { | |
| alert( "error" ); | |
| }) | |
| .always(function() { | |
| alert( "complete" ); | |
| }); | |
| // Perform other work here ... | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment