2009-09-11 150 views
1

我爲Runecape論壇製作了Greasemonkey腳本(是runescape!:p),我正在嘗試查找統計信息。jQuery Ajax問題

$('.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未執行的錯誤。也在螢火蟲說POST或GET說它的選項。

爲什麼這樣做呢?

我以爲mabey它的事實,即阿賈克斯不跨越不同的領域,但這只是一個不同的子域,我認爲Greasemonkey無視這一點。

+1

如果你試圖打開URL傳遞在瀏覽器加載,它做你期待什麼? – inkedmn 2009-09-11 21:16:25

+0

@inkedmn是的,它在瀏覽器中很好。 – 2009-09-11 21:20:35

回答

0

嘗試刪除:

http://hiscore.runescape.com/ 

從地址裝載功能。

+0

由於腳本正在http://forum.runescape.com /上運行,因此不起作用... – 2009-09-11 21:23:19