你现在正在访问的是萌娘百科用于保存和管理图片、音频等媒体文件的子项目萌娘共享,想要回到萌娘百科,请使用浏览器上的返回按钮、或点击这里
“User:サンムル/js/linksToImage.js”的版本间的差异
小 |
小 |
||
第12行: | 第12行: | ||
}, | }, | ||
error: function(XHR, msg, e) { | error: function(XHR, msg, e) { | ||
− | $(nolinks).replaceWith($('<p />').html('获取链入错误:' + $('<font color="red" />').text(msg))) | + | $(nolinks).replaceWith($('<p />').html('获取链入错误:' + $('<font color="red" />').text(msg).html())) |
}, | }, | ||
dataType: 'html', | dataType: 'html', |
2021年1月27日 (三) 20:38的最新版本
'use strict'; $(function() { if (mw.config.get('wgNamespaceNumber') !== 6) return; // 非File名称空间。 let nolinks = $("div#mw-imagepage-nolinkstoimage"); if (nolinks.length !== 0) $.ajax({ url: 'https://zh.moegirl.org.cn/' + mw.config.get('wgPageName'), success: function(data) { let links = $('div#mw-imagepage-section-linkstoimage', $(data)); if (links.length !== 0) $(nolinks).replaceWith(links); }, error: function(XHR, msg, e) { $(nolinks).replaceWith($('<p />').html('获取链入错误:' + $('<font color="red" />').text(msg).html())) }, dataType: 'html', crossDomain: true }); })