Revision as of 20:41, 11 November 2023 by Donald (talk | contribs) (Created page with "$( document ).ready(function() { if (mw.config.get('wgPageName') === ('User:Donald/Testing')) { // Create the search form HTML var searchFormHTML = '<form action="/wiki...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MediaWiki:PageSpecific.js

From Tycoon Gaming

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
$( 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;
    	}
	}
});