このコードを使用して、サーバーからjsonを取得しています
$(function ()
{
$.ajax({
url: 'fetch.php',
data: "",
dataType: 'json',
success: function(data)
{
jQuery.each(data, function() {
document.write(this[0] + "<br/>" + this[1]);
});
}
});
});
そして私はこれをサーバー側で持っています
$rows = Array();
while($row = mysql_fetch_array($result)){
array_push($rows, $row);
}
echo json_encode($rows);
json を使用して html ファイルを読み込もうとすると、データは表示されますが、ページの読み込みは停止しません。