jQuery Ajax问题

时间:2009-09-11 21:14:26

标签: jquery ajax

我正在为Runecape论坛制作一个Greasemonkey脚本(是的runescape!:p),我正在尝试查找统计信息。

$('.rssc_view_stats').click(function(){
        var this_username = $(this).attr('rel');            
        var stats_box = '<div id="stats_box"></div>';   
        //alert('looking for the stats of' + this_username);
        $(this).after(stats_box);

        $('#stats_box').load('http://hiscore.runescape.com/index_lite.ws?player='+this_username);
    });

但它不起作用。我查看了Firebug中的响应,但响应是空白的,它给了我一个501未实现的错误。同样在firebug中,它表示POST或GET,它表示OPTIONS。

为什么要这样做?

我认为,事实上ajax不能在不同的域中工作,但这只是一个不同的子域,我认为Greasemonkey无论如何都会覆盖它。

2 个答案:

答案 0 :(得分:0)

尝试删除:

http://hiscore.runescape.com/

来自加载函数中的地址。

答案 1 :(得分:0)

似乎我不能用jQuery做,我必须使用greasemonkey函数。

http://diveintogreasemonkey.org/api/gm_xmlhttprequest.html