I am using the following code in index.html
<html>
<head>
<title>Ajax check</title>
<script type="text/javascript" src="jquery-1.8.3.min.js" > </script>
<script type="text/javascript">
$(document).ready(function(){
alert('working...');
$('#ibutton').click(function(e){
e.preventDefault();
alert('double click');
$.ajax({
url: "page.html",
cache: false,
success: function(){
$("#message").text('ajax working..');
},
error: function(){
$("#message").text('error in the page');
}
});
});
});
</script>
</head>
<body>
<form action="page.html">
<input type="button" id="ibutton" value="click here"/>
<div id="message"></div>
</form>
</body>
</html>
In page.html, the only content is 'working...'
when I click the click here button... it shows 'error in the page'... what mistake I have done??
click herebutton?alertthe status code and thrown error in theerror?ajax workingbut in chrome it showserror in the page.error, write this:function(req, opt, thrownerror){alert(thrownerror);}. And post here the alerted stuff ;)