MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
$.ajax({ | |||
url: mw.util.wikiScript('api'), | |||
data: { | |||
action: 'parse', | |||
page: 'SidebarMenu', | |||
format: 'json' | |||
}, | |||
dataType: 'json', | |||
success: function(data) { | |||
console.log('API parse response:', data); | |||
if (data.parse && data.parse.text) { | |||
$('#categorytree-content').html(data.parse.text['*']); | |||
} else { | |||
$('#categorytree-content').html('Failed to load categories.'); | |||
} | } | ||
}); | }, | ||
error: function() { | |||
$('#categorytree-content').html('Error loading categories.'); | |||
} | |||
}); | }); | ||
Revision as of 17:37, 3 July 2025
$.ajax({
url: mw.util.wikiScript('api'),
data: {
action: 'parse',
page: 'SidebarMenu',
format: 'json'
},
dataType: 'json',
success: function(data) {
console.log('API parse response:', data);
if (data.parse && data.parse.text) {
$('#categorytree-content').html(data.parse.text['*']);
} else {
$('#categorytree-content').html('Failed to load categories.');
}
},
error: function() {
$('#categorytree-content').html('Error loading categories.');
}
});