User:Sur/common.js: Difference between revisions

From Deadlock Wiki
Jump to navigation Jump to search
Sur (talk | contribs)
mNo edit summary
Sur (talk | contribs)
m Blanked the page
Tags: Blanking Manual revert
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
function storeValue() {
        // Get the input value
        var inputValue = document.getElementById('inputValue').value;


        // Use JavaScript to dynamically update the #var (normally handled by PHP in the wiki environment)
        mw.loader.using('mediawiki.util', function () {
            var updatedText = '{{#vardefine:storedValue|' + inputValue + '}}';
            mw.util.addCSS(updatedText);
        });
        // Optional: Reload the page to reflect the new stored value in the displayed content
        location.reload();
    }

Latest revision as of 00:47, 23 September 2024