我在不同的服務器中有兩個頁面。使用jQuery通過ajax獲取數據
通過Ajax,我想包括一些數據:這裏有一個例子:link
鏈接工作正常通過的瀏覽器。
jQuery(window).ready(function() {
getPageWithAjax("http://www.betcatcher.com/index.php?page=valuebets&nr_row=6");
function getPageWithAjax(page)
{
//alert(page)
ajaxRequest = $.ajax(
{
url: page,
cache: false,
success: function(msg){ajaxResponse(msg)},
error: function(msg){ajaxResponse('Error loading data.'+msg.status)}
});
}
function ajaxResponse(msg)
{
$("#live_bet_ajax_content").html(msg);
}
});
但是當我試圖獲取數據時出現錯誤。
使用firefox +螢火蟲,並使用網絡標籤,你應該能夠看到那裏有什麼問題。 – melaos
是的,我也使用螢火蟲,但我無法弄清楚問題所在。 –
是您在發送請求的同一個域中請求的網址嗎? –