jQuery: Handling Ajax timeouts
Got this in response:
The jQuery Code START
<script type="text/javascript" src="./jquery-1.5.1.js"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax({ type: "GET", url: "getter.php", data: {data: 1}, success: callback, timeout: 10, error: err });
});
function callback(data, status) {
$("div").text(data);
}
function err(xhr, reason, ex) {
$("div").text(reason);
}
<style type="text/CSS">
<!--
.code { color: red; }
.back { background-color: yellow; }
-->
</style>
</script>
</head>
<body>
<h1>jQuery: Handling Ajax timeouts</h1>
Got this in response: <div></div>