LLWiki正在建設中,歡迎加入我們!
「Widget:Username」修訂間的差異
跳至導覽
跳至搜尋
(创建页面,内容为“<noinclude>{{doc|content=用於{{tl|Username}}。}}</noinclude><includeonly><!--{if !isset($wgWidgetUsername) || !$wgWidgetUsername}--><!--{assign var="wgWidgetUsern…”) 標籤:流動版網頁編輯 流動版編輯 |
小 標籤:流動版網頁編輯 流動版編輯 |
||
第2行: | 第2行: | ||
//</includeonly>JavaScript脚本:<pre lang="js"> |
//</includeonly>JavaScript脚本:<pre lang="js"> |
||
window.addEventListener('load', function() { |
window.addEventListener('load', function() { |
||
var username = mw.config.get('wgUserName'); |
|||
if(!username) { return; } |
|||
document.querySelectorAll( '.username' ).forEach(function(ele) { |
document.querySelectorAll( '.username' ).forEach(function(ele) { |
||
ele.textContent = |
ele.textContent = username; |
||
}); |
}); |
||
}); |
}); |
於 2020年10月23日 (五) 09:29 的修訂
JavaScript腳本:
window.addEventListener('load', function() {
var username = mw.config.get('wgUserName');
if(!username) { return; }
document.querySelectorAll( '.username' ).forEach(function(ele) {
ele.textContent = username;
});
});
//