MediaWiki:Common.js: Difference between revisions

Agros urbe non clamaten
Created page with "→‎Any JavaScript here will be loaded for all users on every page load.: mw.loader.using('mediawiki.util', function () { $(document).ready(function () { // Check the current page title if (mw.config.get('wgPageName') === 'Wiki Visualized') { console.log("This code runs only on the specified page."); // Your custom JavaScript code here } }); });"
 
No edit summary
Line 4: Line 4:
     $(document).ready(function () {
     $(document).ready(function () {
         // Check the current page title
         // Check the current page title
         if (mw.config.get('wgPageName') === 'Wiki Visualized') {
         if (mw.config.get('wgPageName') === 'Wiki_Visualized') {
             console.log("This code runs only on the specified page.");
             console.log("This code runs only on the specified page.");
             // Your custom JavaScript code here
             // Your custom JavaScript code here

Revision as of 00:17, 23 November 2024

/* Any JavaScript here will be loaded for all users on every page load. */

mw.loader.using('mediawiki.util', function () {
    $(document).ready(function () {
        // Check the current page title
        if (mw.config.get('wgPageName') === 'Wiki_Visualized') {
            console.log("This code runs only on the specified page.");
            // Your custom JavaScript code here
        }
    });
});