-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-paths.html
More file actions
93 lines (86 loc) · 2.89 KB
/
Copy pathtest-paths.html
File metadata and controls
93 lines (86 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Path Test - NeonTools</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
line-height: 1.6;
}
.success {
color: green;
font-weight: bold;
}
.error {
color: red;
font-weight: bold;
}
.test-container {
margin-bottom: 20px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
}
</style>
</head>
<body>
<h1>NeonTools Path Test</h1>
<div class="test-container">
<h2>Testing File Existence</h2>
<div id="file-tests"></div>
</div>
<div class="test-container">
<h2>Current Location</h2>
<div id="location-info"></div>
</div>
<div class="test-container">
<h2>Quick Links</h2>
<ul>
<li><a href="index.html">Home Page</a></li>
<li><a href="tools/word-counter.html">Word Counter Tool</a></li>
<li><a href="tools/image-to-png.html">Image to PNG Tool</a></li>
</ul>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Display location info
const locationInfo = document.getElementById('location-info');
locationInfo.innerHTML = `
<p><strong>Current Path:</strong> ${window.location.pathname}</p>
<p><strong>Base URL:</strong> ${window.location.origin}</p>
<p><strong>Full URL:</strong> ${window.location.href}</p>
`;
// Test files
const filesToTest = [
'index.html',
'header.html',
'footer.html',
'css/style.css',
'js/main.js',
'js/tools-data.js',
'img.jpg',
'tools/word-counter.html',
'tools/image-to-png.html'
];
const fileTests = document.getElementById('file-tests');
// Test each file
filesToTest.forEach(file => {
fetch(file)
.then(response => {
if (response.ok) {
fileTests.innerHTML += `<p class="success">✓ ${file} exists</p>`;
} else {
fileTests.innerHTML += `<p class="error">✗ ${file} not found (${response.status})</p>`;
}
})
.catch(error => {
fileTests.innerHTML += `<p class="error">✗ Error checking ${file}: ${error.message}</p>`;
});
});
});
</script>
</body>
</html>