MediaWiki:Common.js:修订间差异
外观
![]() |
|||
第5行: | 第5行: | ||
username = document.getElementById("pt-userpage").a.innerHtml | username = document.getElementById("pt-userpage").a.innerHtml | ||
alert(username) // test | alert(username) // test | ||
/**百度推送 */ | |||
function baiduPush() { | |||
var bp = document.createElement('script'); | |||
var src = window.location.protocol.indexOf('https') !== -1 | |||
? 'https://zz.bdstatic.com/linksubmit/push.js' | |||
: 'http://push.zhanzhang.baidu.com/push.js'; | |||
bp.src = src; | |||
bp.setAttribute('async', ''); // 最好异步加载 | |||
document.body.appendChild(bp); | |||
} |
2021年10月16日 (六) 08:56的版本
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ mw.loader.load('https://wikiplus-app.com/Main.js') // load user css and js username = document.getElementById("pt-userpage").a.innerHtml alert(username) // test /**百度推送 */ function baiduPush() { var bp = document.createElement('script'); var src = window.location.protocol.indexOf('https') !== -1 ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js'; bp.src = src; bp.setAttribute('async', ''); // 最好异步加载 document.body.appendChild(bp); }