javascript:x=XMLHttpRequest();x.open("get","https://dns.google.com/resolve?name="+prompt("",""),false);x.send();alert(JSON.parse(x.responseText).Answer.pop().data);
|
1
six
|
|
kacongJul 11, 2017
2
smart bookmark.
|
|
lslqtzJul 11, 2017
3
Uncaught TypeError: Failed to construct 'XMLHttpRequest': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
|
|
lslqtzJul 11, 2017
4
javascript:x=new XMLHttpRequest();x.open("get","https://dns.google.com/resolve?name="+document.domain,false);x.send();alert(JSON.parse(x.responseText).Answer.pop().data);
改了个查当前域名的。 |
|
autoxbcJul 11, 2017
6
挺好。不过现在满世界 CDN,查出来的都不是本地最佳镜像,我直接在路由上架了个查询服务。
|
|
crystoneJul 11, 2017
8
怎么使用呢
|
|
autoxbcJul 11, 2017
9
@shadownet 和楼主这个差不多,只是不走 google 的查询,在路由查询并返回,cgi 脚本是这样的
https://gist.github.com/anonymous/febfaa031558684014006da335ec2f0b 用 Web Server 的 cgi 模式运行,不能是 fast-cgi。 然后就是浏览器调用,就是上面这种小书签脚本。我用浏览器本身的私有方法跨域,所以 Web Server 里没有再设置允许跨域的 header。 |