User:SwedishTurtles/edits.js
Jump to navigation
Jump to search
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
$(function() {
// test if user is seeing their own user page.
// only the current uuser's edit count is available through mw.config
// but it's possible to get other users' data as well;
// see [[User:PleaseStand/userinfo.js]] and [[User:UBX/LiveEditCounter.js]] for example
if( mw.config.get('wgPageName').indexOf('User:' + mw.config.get('wgUserName')) == 0 ) {
// Get values
var edits = mw.config.get('wgUserEditCount');
// Show result
$('#edits').text( edits );
}
});