added inline script test for fundamental JavaScript debugging
This commit is contained in:
25
pacman.html
25
pacman.html
@@ -63,7 +63,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Mobile Space Button -->
|
<!-- Mobile Space Button -->
|
||||||
<button id="mobileSpaceBtn" class="mobile-space-btn" style="display: none;">SPACE</button>
|
<button id="mobileSpaceBtn" class="mobile-space-btn" style="display: block; background: #ff0; color: #000; font-size: 20px; padding: 20px;">SPACE BUTTON TEST</button>
|
||||||
|
|
||||||
<!-- Debug Info -->
|
<!-- Debug Info -->
|
||||||
<div id="debugInfo" class="debug-info">
|
<div id="debugInfo" class="debug-info">
|
||||||
@@ -72,6 +72,29 @@
|
|||||||
<div>Controls: <span id="controlsStatus">Hidden</span></div>
|
<div>Controls: <span id="controlsStatus">Hidden</span></div>
|
||||||
<button onclick="testMobileControls()" style="margin-top: 5px; padding: 2px 5px; font-size: 10px;">TEST</button>
|
<button onclick="testMobileControls()" style="margin-top: 5px; padding: 2px 5px; font-size: 10px;">TEST</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Inline Test Script -->
|
||||||
|
<script>
|
||||||
|
console.log('=== INLINE SCRIPT START ===');
|
||||||
|
alert('Inline script is running!');
|
||||||
|
|
||||||
|
// Test button directly
|
||||||
|
var testBtn = document.getElementById('mobileSpaceBtn');
|
||||||
|
console.log('Test button found:', testBtn);
|
||||||
|
|
||||||
|
if (testBtn) {
|
||||||
|
testBtn.onclick = function() {
|
||||||
|
console.log('BUTTON CLICKED!');
|
||||||
|
alert('BUTTON CLICKED!');
|
||||||
|
document.body.style.backgroundColor = '#ff0000';
|
||||||
|
};
|
||||||
|
console.log('Button click handler attached');
|
||||||
|
} else {
|
||||||
|
console.log('BUTTON NOT FOUND!');
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('=== INLINE SCRIPT END ===');
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const canvas = document.getElementById('gameCanvas');
|
const canvas = document.getElementById('gameCanvas');
|
||||||
|
|||||||
Reference in New Issue
Block a user