Difference between revisions of "User:BelgianCat/common.js"

From Tycoon Gaming
(User JS enabled? test)
 
m (testing alternative code (probably user JS and CSS disabled though lol))
 
Line 1: Line 1:
// Define a function called addLastPageButton
+
function iniFrame() {  
function addLastPageButton() {  
+
var output;
// create a new variable called 'output'
+
window.element = document.getElementById("globalWrapper");
    var output;
+
var save = window.element.innerHTML;
    // Create a new div element to contain the button
+
output = '<button class="LastPageTest" onclick="var oldURL = document.referrer; window.location.href = oldURL;"><b>Return to Last Page</b></button>';
    var container = document.createElement("div");
+
window.element.innerHTML = save + output;
    // Set the innerHTML of the container to the button code
 
    container.innerHTML = '<button class="LastPageTest" onclick="var oldURL = document.referrer; window.location.href = oldURL;"><b>Return to Last Page</b></button>';
 
    // Append the container to the body of the page
 
    document.body.appendChild(container);
 
 
 
 
}
 
}
 
+
iniFrame();
// Call the addLastPageButton function when the page loads
 
addLastPageButton();
 

Latest revision as of 22:04, 3 May 2023

function iniFrame() { 
	var output;
	window.element = document.getElementById("globalWrapper");
	var save = window.element.innerHTML;
	output = '<button class="LastPageTest" onclick="var oldURL = document.referrer; window.location.href = oldURL;"><b>Return to Last Page</b></button>';
	window.element.innerHTML = save + output;
}
iniFrame();