sidebar
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| sidebar [2023/05/08 06:36] – kisu_odd | sidebar [2024/03/02 08:21] (current) – kisu_odd | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| [[:Featured Articles|Featured Articles]]\\ | [[:Featured Articles|Featured Articles]]\\ | ||
| [[: | [[: | ||
| - | [[wiki: | + | [[wiki: |
| - | [[https:// | + | <p id=" |
| + | |||
| + | < | ||
| + | function randomRedirect() { | ||
| + | // List of links | ||
| + | var links = [ | ||
| + | "https:// | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | |||
| + | |||
| + | // Add more links here | ||
| + | | ||
| + | |||
| + | // Generate a random index | ||
| + | var randomIndex = Math.floor(Math.random() * links.length); | ||
| + | |||
| + | // Get the paragraph element | ||
| + | var paragraph = document.getElementById(" | ||
| + | |||
| + | // Create a new anchor element | ||
| + | var linkElement = document.createElement(" | ||
| + | linkElement.href = links[randomIndex]; | ||
| + | linkElement.textContent = " | ||
| + | |||
| + | // Append the anchor element to the paragraph | ||
| + | paragraph.appendChild(linkElement); | ||
| + | } | ||
| + | |||
| + | // Call randomRedirect function when the page loads to display a random link immediately | ||
| + | window.onload = randomRedirect; | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| \\ | \\ | ||
| | | ||
sidebar.1683527804.txt.gz · Last modified: 2023/05/08 06:36 by kisu_odd
