2011-07-21 28 views
0

我有這樣的Ajax請求:阿賈克斯與jQuery在Firefox,並得到404錯誤在Chrome

$.ajax({ 
    dataType: 'json', 
    error: function(result) { 
     alert('Error: ' + result.status); 
    }, 
    type: 'GET', 
    data: "", 
    success: function(data) { 
     //do some stuff 
    }, 
    url: 'info/' + hash + '.json' 
}); 

雖然在Firefox這一偉大工程,在Chrome中我得到一個404錯誤,我怎麼能修復它在Chrome中工作?

+0

是什麼'hash'? – Neal

+0

嘗試在頂部 – Rafay

+0

指定網址,如果您不發送數據只是不指定它 – Rafay

回答

0

嘗試使用一個完整的URL-

url: 'http://yoursite.com/YourDirectorys/info/' + hash + '.json 

或相對一個沒有URL-

url: '/YourDirectorys/info/' + hash + '.json