2
嘗試讓此AJAX請求生效。任何身體部分都隱藏起來,就像事件處理程序要做的第一行一樣。但是,about.html中的內容不會加載,因此我不會收到錯誤消息。有任何想法嗎?無法獲得基本的AJAX腳本,只能使用jQuery和Javascript。
$(document).ready(function() {
//AJAX About.html
$('#about-button').on('click', function() {
$('body section').hide(),
$.ajax('about.html'), {
success: function(response) {
$('.about-page').html(response).slideDown()
},
error: function(request, errorType, errorMessage) {
$('body').html("<p> 'Error: ' + errorType + ' with message ' + errorMessage </p>")
},
timeout: 3000
};
});
});
謝謝您的幫助! – user3709721
謝謝@ jfriend00! – user3709721