這裏是我的index.html文件現場AJAX數據
$(document).ready(function() {
$.ajax({
url: 'ajax.php',
type: 'GET',
dataType: "json",
beforeSend: function()
{
},
complete: function()
{
},
success: function(result)
{
$("p").html(result.price);
$("p").live("load", function() {
$(this).html(result.price);
});
}
});
});
這裏是ajax.php文件(我沒有把json_decode,只是把VAL就像是對測試)
{"price":"o"}
什麼即時試圖做的是,如果我去到ajax.php文件,改變O至別的東西,我希望將數據自動更新,並顯示索引頁上沒有刷新,但我不能似乎讓它工作。任何人看到我做錯了什麼?
你可以使用螢火蟲和檢查網絡面板如何請求 – kobe 2011-05-07 06:46:27
在這裏你去我檢查它,但你也可以看到。我改變了php文件,顯示一個隨機數,像蘭特(0,10000)http://69.231.223.112:8888/test/ – 2011-05-07 06:49:01
@same,你會感覺到對嗎?有什麼問題然後 – kobe 2011-05-07 07:00:50