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>
では、ボタンpage.html
をクリックすると「動作中...」というコンテンツのみがclick here
表示されます...「ページ内のエラー」が表示されます...どのような間違いをしましたか??