I've made this simple html page but get "error" alert popup when calling example.com. Why?
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script type="text/javascript">
function errorAlert(e, jqxhr) {
alert("Your request was not successful: " + jqxhr);
}
function processData() {
alert("success")
}
$.ajax(
{
type: "post",
url: "http://example.com",
success: processData,
error: errorAlert
}); //end of $.ajax
</script>
</body>
</html>
I'm running on Chrome 45.0...