0
IE7 &을 제외한 모든 브라우저에서 JSON 컨텐츠가로드됩니다. 이유가 무엇인지 모르겠습니다. 다음 코드는 어떤 아이디어입니까? 감사!JSON이 IE7 & 8에로드되지 않습니다.
$(document).ready(function() {
function loadContent(){
$.ajax({
url: "json/content.json",
data: "nocache=" + Math.random(),
type: "GET",
contentType: "application/json",
dataType: "json",
success: function(source){
data = source;
showStartpage(data);
showInfo(data);
},
error: function(data){
alert("Failed to load content");
}
});
}
function showStartpage(){
$(".start .text3").html(data[lang]['startpage']['text3']);
$(".start .text4").html(data[lang]['startpage']['text4']);
$(".start .text5").html(data[lang]['startpage']['text5']);
$(".start .text6").html(data[lang]['startpage']['text6']);
$(".start .text7").html(data[lang]['startpage']['text7']);
}
loadContent();
showStartpage();
}
F-12를 눌러 디버거를 열고 CONSOLE을보고 오류를 확인하십시오. "작동하지 않음"은 많은 문제를 해결하는 데 도움이되지 않습니다. –
IE7에서는 F-12가 없습니다. – SteveP
대신'cache : false'를 설정하면'data : "nocache ="+ Math.random()'을 포함 할 필요가 없습니다. – Blazemonger