MediaWiki:DonationFormSandbox.js: Difference between revisions

Content deleted Content added
Testing grabbing URL parameter for FundraiseUp.
Tag: Reverted
mNo edit summary
Tag: Reverted
Line 1,502:
// Check if the 'fundraiseupScript' parameter exists in the URL and is set to '1'
if (mw.util.getParamValue('fundraiseupScript') === '1') {
// Insert the template into a specific element on the page
// Code to load or execute your template
mw.loader.using('mediawiki.api').then(function() {
console.log("fundraiseupScript parameter is set to 1");
new mw.Api().get({
// Insert additional code here, e.g., load a template
action: 'parse',
page: 'Template:Footer/PrivacyThirdParty/Default',
prop: 'text',
format: 'json'
}).done(function(data) {
if (data.parse && data.parse.text) {
// Append the template content to a specific place on the page
console.log("Appending content:", data.parse.text['*']);
}
});
});
}