我正在为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表示选项。
它为什么要这么做?
我想可能是ajax不能跨不同的域工作,但这只是一个不同的子域,我认为Greasemonkey无论如何都会覆盖这一点。
发布于 2009-09-11 21:33:22
似乎我不能用jQuery来做这件事,我必须使用一个greasemonkey函数。
http://diveintogreasemonkey.org/api/gm_xmlhttprequest.html
发布于 2009-09-11 21:20:47
尝试删除:
http://hiscore.runescape.com/load函数中的from地址。
https://stackoverflow.com/questions/1413308
复制相似问题