0
안녕 얘들 아. 나는 인터넷 익스플로러에서 작동하지 않는 us/ajax 스크립트이다. Firefox는 괜찮습니다.ajax jquery는 ie에서 작동하지 않습니다.
switch($_GET['page']) {
case '#link1' : $page = 'contenthere'; break;
}
echo $page;
그래서, 링크, 내가 ': 같은 것을 페이지를 얻을 수
$(document).ready(function() {
//Check if url hash value exists (for bookmark)
$.history.init(pageload);
//highlight the selected link
$('a[href=' + document.location.hash + ']').addClass('selected');
//Seearch for link with REL set to ajax
$('a[rel=ajax]').click(function() {
//grab the full url
var hash = this.href;
//remove the # value
hash = hash.replace(/^.*#/, '');
//for back button
$.history.load(hash);
//clear the selected class and add the class class to the selected link
$('a[rel=ajax]').removeClass('selected');
$(this).addClass('selected');
//hide the content and show the progress bar
$('#content').hide();
$('#loading').show();
//run the ajax
getPage();
//cancel the anchor tag behaviour
return false;
});
});
function pageload(hash) {
//if hash value exists, run the ajax
if (hash) getPage();
}
function getPage() {
//generate the parameter for the php script
var data = 'page=' + encodeURIComponent(document.location.hash);
$.ajax({
url: "http://pathfofolder/js/loader.php",
type: "GET",
data: data,
cache: false,
success: function (html) {
//hide the progress bar
$('#loading').hide();
//add the content retrieved from ajax and put it in the #content div
$('#content').html(html);
//display the body with fadeIn transition
$('#content').fadeIn('slow');
}
});
}
loader.php는 PHP 코드를 포함
: 메신저이 사용Btw는 머리 태그, m 링크 1을 사용하여 콘텐츠를 div 콘텐츠에로드합니다.
이 스크립트는 firefox에서는 잘 작동하지만 Internet Explorer에서는 콘텐츠를로드하지 않습니다. 누군가가이 문제를 해결할 수 있도록 도와 주시겠습니까?
IE에서 전혀 성공 함수로 들어 가지 않으며 IE에서 html 오류도 발생하지 않습니다.
좋습니다.
IE에서 자바 스크립트 오류가 발생합니까? 반환 내용을 경고 할 때 올바른지, 아니면 성공 함수로 전혀 들어가지 않습니까? –
모든 탄두에서 성공 기능에 들어 가지 않습니다. – Ricardo
등록하지 않았으므로 브라우저 쿠키가 삭제 될 때마다 계정을 제어 할 수 없게됩니다. 쿠키가 활성화되어 있으면이 페이지의 모든 게시물에 대한 질문 및 의견을 수정할 수 있습니다. –