![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/.cursor-server/data/User/History/-d4f4af9/ |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AJAX Debug Test</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
background: #1a1a1a;
color: white;
}
.test-section {
margin: 20px 0;
padding: 20px;
border: 1px solid #333;
border-radius: 8px;
}
.test-button {
background: #667eea;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
margin: 5px;
}
.test-button:hover {
background: #5a67d8;
}
.result {
margin-top: 10px;
padding: 10px;
background: #2d2d2d;
border-radius: 5px;
white-space: pre-wrap;
}
.error {
background: #e53e3e;
color: white;
}
.success {
background: #38a169;
color: white;
}
</style>
</head>
<body>
<h1>🔧 AJAX Debug Test</h1>
<div class="test-section">
<h2>1. AJAX Navigation Script Test</h2>
<button class="test-button" onclick="testAjaxScript()">Test AJAX Script Loading</button>
<div id="ajax-script-result" class="result"></div>
</div>
<div class="test-section">
<h2>2. AJAX Load Page Test</h2>
<button class="test-button" onclick="testAjaxLoad()">Test AJAX Load Page</button>
<div id="ajax-load-result" class="result"></div>
</div>
<div class="test-section">
<h2>3. Session Test</h2>
<button class="test-button" onclick="testSession()">Test Session</button>
<div id="session-result" class="result"></div>
</div>
<div class="test-section">
<h2>4. Navigation Links Test</h2>
<a href="/dashboard.php" class="test-button">Dashboard Link</a>
<a href="/community_fixed.php" class="test-button">Community Link</a>
<a href="/library.php" class="test-button">Library Link</a>
<div id="navigation-result" class="result">Click the links above to test navigation</div>
</div>
<script>
function testAjaxScript() {
const result = document.getElementById('ajax-script-result');
result.innerHTML = 'Testing...';
if (typeof window.ajaxNavigation !== 'undefined') {
result.innerHTML = '✅ AJAX Navigation script is loaded and available\n';
result.innerHTML += 'Current page: ' + (window.ajaxNavigation.getCurrentPage() ? 'Yes' : 'No') + '\n';
result.innerHTML += 'Is navigating: ' + window.ajaxNavigation.isNavigating() + '\n';
result.className = 'result success';
} else {
result.innerHTML = '❌ AJAX Navigation script is NOT loaded\n';
result.innerHTML += 'Available window objects: ' + Object.keys(window).filter(k => k.includes('ajax')).join(', ') + '\n';
result.className = 'result error';
}
}
function testAjaxLoad() {
const result = document.getElementById('ajax-load-result');
result.innerHTML = 'Testing AJAX load...';
fetch('/ajax_load_page.php?page=community', {
method: 'GET',
credentials: 'include',
headers: {
'X-Requested-With': 'XMLHttpRequest'
}
})
.then(response => response.json())
.then(data => {
result.innerHTML = '✅ AJAX Load Response:\n';
result.innerHTML += JSON.stringify(data, null, 2);
result.className = 'result success';
})
.catch(error => {
result.innerHTML = '❌ AJAX Load Error:\n' + error.message;
result.className = 'result error';
});
}
function testSession() {
const result = document.getElementById('session-result');
result.innerHTML = 'Testing session...';
fetch('/ajax_load_page.php?page=dashboard', {
method: 'GET',
credentials: 'include',
headers: {
'X-Requested-With': 'XMLHttpRequest'
}
})
.then(response => response.json())
.then(data => {
result.innerHTML = 'Session Test Response:\n';
result.innerHTML += JSON.stringify(data, null, 2);
result.className = data.success ? 'result success' : 'result error';
})
.catch(error => {
result.innerHTML = '❌ Session Test Error:\n' + error.message;
result.className = 'result error';
});
}
// Test navigation links
document.addEventListener('click', function(e) {
if (e.target.tagName === 'A' && e.target.href) {
const result = document.getElementById('navigation-result');
result.innerHTML = '🔄 Testing navigation to: ' + e.target.href + '\n';
result.innerHTML += 'AJAX should handle this if working properly.';
result.className = 'result';
}
});
// Auto-test on load
window.addEventListener('load', function() {
setTimeout(testAjaxScript, 1000);
});
</script>
<!-- Include AJAX navigation script -->
<script src="/js/ajax_navigation.js"></script>
</body>
</html>