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:




$(document).ready(function() {
$(window).on('load', function() {
     // Test if the script is running
     // Test if the script is running
     alert('Test');
     alert('Test');
Line 727: Line 727:
         });
         });


     // Add the button to the content area
     // Wait until the content is fully loaded and then insert the button
     $('#mw-content-text').prepend(downloadButton); // Use .append() if you want it at the bottom
     var contentArea = $('#mw-content-text');
    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