7 Star 32 Fork 13

imba久期 / js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
js-47.js 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
imba久期 提交于 2020-07-18 14:28 . #47,#48,#49,#50
if(typeof koe_47_p === 'undefined') {
var koe_47_p = document.createElement('p');
koe_47_p.setAttribute('style', 'position: fixed; top: 50%; left: 50%; padding: 10px; font-size: 20px; color: #FFF; background-color: #000; -webkit-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); transform: translate(-50%, -50%); z-index: 99999999; display: none;');
koe_47_p.ondblclick = function() {
this.style.display = 'none';
}
document.body.appendChild(koe_47_p);
}
var koe_47_selected = window
.getSelection()
.toString()
.replace(/(^\s+|\s+$)/, '');
if (koe_47_selected !== '') {
var koe_47_xhr = new XMLHttpRequest();
koe_47_xhr.open(
'GET',
'https://bili.imba97.cn/ji.php?kw=' + koe_47_selected,
true
);
koe_47_xhr.send();
koe_47_xhr.onreadystatechange = function () {
if (koe_47_xhr.readyState === 4 && koe_47_xhr.status === 200) {
var json = JSON.parse(koe_47_xhr.responseText);
koe_47_p.innerHTML = json.data.replace(/(\\n|\\r)/g, '') + '【<a style="color: #FFF; font-weight: 700;" target="_blank" href="https://jikipedia.com/search?phrase=' + koe_47_selected + '">查看详情</a>】';
koe_47_p.style.display = 'block';
}
};
} else {
koe_47_p.style.display = 'none';
}
JavaScript
1
https://gitee.com/imba97/js.git
git@gitee.com:imba97/js.git
imba97
js
js
master

搜索帮助