0
我試圖學習如何Ajax的作品,所以我寫了幾個腳本,但是當我點擊按鈕,page.html沒有被加載! 我使用jQuery v1.11.1 的index.html如何通過ajax加載文件?
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>Demo</title>
</head>
<body> \t
<input id="button" type="button" value="Load" />
<div id="content"></div>
\t <script type="text/javascript" src="../js/jquery.js"></script>
\t <script type="text/javascript" src="ajax.js"></script>
</body>
</html>
ajax.js
$('#button').click(function(){
\t $.ajax({
\t \t url: 'page.html',
\t \t succuss: function(data){
\t \t \t $('#content').html(data);
\t \t }
\t });
});
page.html中
Ajax請求你的代碼<strong>Loaded Ok!</strong>
謝謝是的,這是錯字:)我會接受您的答案 – 2014-10-16 13:14:54