Difference between revisions of "MediaWiki:PageSpecific.js"
From Tycoon Gaming
(Created page with "$( document ).ready(function() { if (mw.config.get('wgPageName') === ('User:Donald/Testing')) { // Create the search form HTML var searchFormHTML = '<form action="/wiki...") |
(No difference)
|
Revision as of 21:41, 11 November 2023
$( document ).ready(function() { if (mw.config.get('wgPageName') === ('User:Donald/Testing')) { // Create the search form HTML var searchFormHTML = '<form action="/wiki/index.php" method="get">' + '<input type="hidden" name="title" value="Special:Search">' + '<input type="text" name="search" placeholder="Search the wiki" />' + '<input type="submit" value="Go" />' + '</form>'; // Identify the element where you want to add the search form var pageElement = document.getElementById('testaddsearchbar'); // Replace 'someElementID' with the actual ID // Insert the search form HTML into the identified element if (pageElement) { pageElement.innerHTML = searchFormHTML; } } });