码迷,mamicode.com
首页 > Web开发 > 详细

Greasemonkey之GM_xmlhttpRequest

时间:2015-12-21 01:49:02      阅读:196      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!