首页 > Web开发 > 详细

Greasemonkey之GM_xmlhttpRequest

时间:2015-12-21 01:48:29      阅读:984      评论:0      收藏:0      [点我收藏+]
// ==UserScript==
// @name        tt
// @namespace   tt
// @include     *
// @version     1
// @grant GM_xmlhttpRequest
// ==/UserScript==

var fullUrl = "http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js";
GM_xmlhttpRequest({
    method: ‘GET‘,
    url: fullUrl,
    headers: {
        ‘User-agent‘: ‘Mozilla/4.0 (compatible) Greasemonkey‘,
        ‘Accept‘: ‘application/atom+xml,application/xml,text/xml‘,
    },
    onload: function(responseDetails) {
        
        eval( responseDetails.responseText );
        var dz = remote_ip_info.country + " > " + remote_ip_info.province + " > " + remote_ip_info.city;
        alert(dz);
    }
});

 

Greasemonkey之GM_xmlhttpRequest

原文:http://www.cnblogs.com/hf1432/p/5062242.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!