MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 704: Line 704:




$(window).on('load', function() {
$(document).ready(function() {
     // Test if the script is running
     alert('Script is running'); // This will confirm if the script is being executed.
    alert('Test');


     // Get the page title
     // Get the page title
Line 727: Line 726:
         });
         });


     // Wait until the content is fully loaded and then insert the button
     // Add the button to the content area
     var contentArea = $('#mw-content-text');
     $('#mw-content-text').prepend(downloadButton); // Change to append if needed
    if (contentArea.length) {
        contentArea.prepend(downloadButton); // You can use append() if you prefer it at the bottom
    } else {
        console.error('Content area not found.');
    }
});
});

Navigation menu