Sandbox: Difference between revisions
From Hidden Mickey Wiki
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<htmltag tagname="script" type="text/javascript"> | <htmltag tagname="script" type="text/javascript"> | ||
(function() { | document.addEventListener('DOMContentLoaded', function() { | ||
console.log('Debug: JS script is running!'); // This confirms the JS is executing | |||
// | // Optional visible confirmation on the page | ||
var | var debugNotice = document.createElement('div'); | ||
debugNotice.innerText = 'Debug: JS script is running!'; | |||
debugNotice.style.color = 'red'; | |||
debugNotice.style.fontWeight = 'bold'; | |||
debugNotice.style.margin = '10px 0'; | |||
document.body.appendChild(debugNotice); | |||
(function() { | |||
var ids = ['Sandbox1','Sandbox2','Sandbox3']; | |||
var | |||
// Create table | |||
var table = document.createElement('table'); | |||
table.style.borderCollapse = 'collapse'; | |||
table.style.margin = '10px 0'; | |||
table.style.width = '300px'; | |||
// | // Table header | ||
var | var header = table.insertRow(); | ||
['ID','Checkbox State','Timestamp'].forEach(function(text) { | |||
var th = document.createElement('th'); | |||
th.innerText = text; | |||
th.style.border = '1px solid black'; | |||
th.style.padding = '4px'; | |||
th.style.textAlign = 'center'; | |||
th.style.fontWeight = 'bold'; | |||
header.appendChild(th); | |||
}); | |||
// Fill rows | |||
ids.forEach(function(id) { | |||
var row = table.insertRow(); | |||
// ID | |||
var cellId = row.insertCell(); | |||
cellId.innerText = id; | |||
Revision as of 10:18, 1 October 2025
<htmltag tagname="script" type="text/javascript"> document.addEventListener('DOMContentLoaded', function() {
console.log('Debug: JS script is running!'); // This confirms the JS is executing
// Optional visible confirmation on the page
var debugNotice = document.createElement('div');
debugNotice.innerText = 'Debug: JS script is running!';
debugNotice.style.color = 'red';
debugNotice.style.fontWeight = 'bold';
debugNotice.style.margin = '10px 0';
document.body.appendChild(debugNotice);
(function() {
var ids = ['Sandbox1','Sandbox2','Sandbox3'];
// Create table
var table = document.createElement('table');
table.style.borderCollapse = 'collapse';
table.style.margin = '10px 0';
table.style.width = '300px';
// Table header
var header = table.insertRow();
['ID','Checkbox State','Timestamp'].forEach(function(text) {
var th = document.createElement('th');
th.innerText = text;
th.style.border = '1px solid black';
th.style.padding = '4px';
th.style.textAlign = 'center';
th.style.fontWeight = 'bold';
header.appendChild(th);
});
// Fill rows
ids.forEach(function(id) {
var row = table.insertRow();
// ID
var cellId = row.insertCell();
cellId.innerText = id;