우리는 몇 주 전에 사이트를 릴리스했으며 현재 Internet Explorer 6-10에서 웹 사이트가 작동하지 않는다는 불만을 표시하고 있습니다.앵커가있는 페이지 검색 IE에서 작동하지 않는 AJAX
임 사용하여 jQuery를 버전 : 1.11.0
우리는 앵커와 함께 각 페이지를로드하는 AJAX를 실행하고 있습니다. 예를 들어. www.site.com/#page2
나는 코드를 디버깅하려고 시도하고 어디서 실패했는지 알지만 무엇이 잘못되었는지는 알지 못합니다.
사람들이 겪고있는 문제는 간단하고 페이지가로드되지 않습니다. 페이지 호출을 제외한 다른 모든 코드가 작동합니다. 기본적으로 페이지는 비어 있습니다.
이 코드의 간략화 된 버전이다 미리
<a onclick="retrieve_page('page1', 'sv')">Page1</a>
감사 :
function retrieve_page(link, lang){
event.preventDefault();
var id = link;
if(id){
document.location = "#"+id;
} else {
document.location = "#hem";
}
if(window.location.hash.substring(1) != "undefined") {
var page = window.location.hash.substring(1);
} else {
var page = "hem";
}
var content;
var request = $.ajax({
type: "GET",
url: "ajax/retriever.php",
data: { page:page },
success: function(data) {
content = data;
}
});
request.done(function() {
$('#page').html(content);
});
}
이이 ajax/retriever.php
파일
<?php
$page = $_GET["page"];
$path = "../pages/".$page.".php";
$config = "../core/config.php";
if(!file_exists($path)){
require_once $config;
echo "<div id='no_page'><h1 style='display: block'>".$lang["ERROR"]."</h1><a href='index.php'><h2>".$lang["ERROR_RETURN"]."</h2></a></div>";
exit;
} else {
require_once $config;
require_once $path;
exit;
}
?>
는 AJAX 함수 호출은 예는 !
어떤 버전의 jQuery를 사용하고 있습니까 1.xx 또는 2.xx 버전 2는 IE의 이전 버전을 지원하지 않습니다 – jeff
언급을 잊어 버렸습니다. 1.11.0 – Jacob