문제 : 현재 내 웹 페이지에는 결과가 표시되지만 임의의 장소와 google.js는 시작되지 않습니다. concole에서 문제를 해결하면 game_statistics.inc가 발견되지 않습니다. 그러나 그것은 거기에있다. js 파일이 웹 폴더에 있고 game_statistic.inc가 액세스 위의 폴더이기 때문에 액세스 문제 일 수 있습니까? 그것을 고치는 방법? 결과를 html 파일로 에코하려면 어떻게해야합니까?jquery가 포함 된 루트 폴더 php에 액세스 할 수 없습니다.
클라이언트/SRC/SMS/gamestatistics.inc 파일
$GAnalytics = "SELECT GAnalyticsEST, GAnalyticsRUS FROM GAME_game WHERE id = ".$GID." ; ";
$res= mysql_query($GAnalytics);
$resul = array();
while ($row = mysql_fetch_array($res))
array_push($resul, array('GAnalyticsEST' => $row[0], 'GAnalyticsRUS' => $row[1]));
echo json_encode(array("resul"=>$resul));
클라이언트/웹/google.js 코드 :
$(document).ready(function() {
done();
});
function done() {
setTimeout(function() {
updates();
done();
}, 9000);
}
function updates() {
$.getJSON('../src/sms/game_statistics.inc', function(data) {
$("ul").empty();
$.each(data.resul, function(){
$("ul").append("<li>GoogleEST: "+this['GAnalyticsEST']+"</li><li>GoogleRUS: "+this['GAnalyticsRUS']+"</li><br />");
});
});
}