User:Bhsd/widget/list.js

< User:Bhsd‎ | widget
Bhsd讨论 | 贡献2020年10月21日 (三) 23:44的版本

注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:前往菜单 → 设置(Mac为Opera → Preferences),然后隐私和安全 → 清除浏览数据 → 缓存的图片和文件
// 代码迁移自[https://github.com/bhsd-harry/list]
function main($) {
    $.getJSON('/zh?title=user:bhsd/list.json&action=raw&ctype=application/json', function(str) {
        var data = JSON.parse(str);
        $('.widget-test').html('<a href="/zh/User:Bhsd/list.js" title="User:Bhsd/list.js">User:Bhsd/list.js</a>' +
            data.test ? '' : '由于JSON未' +
            '成功加载!');
    });
}

var jqueryTimer = setInterval(function() {
    if(window.jQuery) {
        clearInterval(jqueryTimer);
        main(jQuery);
    }
}, 100);