Created
March 7, 2013 06:37
-
-
Save josephj/5105989 to your computer and use it in GitHub Desktop.
Cross-domain testing.
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>XMLHttpRequest Cross Domain</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<style type="text/css"> | |
</style> | |
</head> | |
<body> | |
<div> | |
</div> | |
<script> | |
$.ajax({ | |
type: "GET", | |
url: "http://106.187.98.37/2013/ajax-crossdomain/ajax.txt", | |
timeout: 2000, | |
dataType: "json", | |
success: function (o) { | |
alert("[SUCCESS] Message = " + o.message); | |
}, | |
error: function (o) { | |
alert("[ERROR] Error Status = " + o.status); | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Demo Page - http://lab.josephj.com/2013/ajax-crossdomain/demo.php