1
안녕하십니까. 처음으로 게시하고 총 Ajax 멍청한 녀석입니다.Ajax GET 오류가 발생했습니다.
는그냥 내가 정말 잘못 갔어요 곳 누구나 지적 할 수 있다면, 내가
// JQuery와 아약스로드를 처리 할 수있는 모든 도움을 주셔서 감사 궁금해하는 것은
//Function to handle back and forward
var pooped = ('state' in window.history && window.history.state !== null),
initialURL = location.href;
//function to handle the scenarios where back and forward buttons used in browser
$(window).bind("popstate", function (e) {
// Ignore inital popstate that some browsers fire on page load
var initialPoop = !pooped && location.href == initialURL;
pooped = true;
if (initialPoop) {
return;
}
ajaxLinkPage(location.href);
});
// Ajax Link function
var ajaxLinkPage = function (linkurl) {
console.log(linkurl);
$.ajax({
type: 'GET',
url: linkurl,
data: {},
complete: function (data) {
$('#body_wrap').html($("#body_wrap", data.responseText).html());
history.pushState({
page: linkurl
}, linkurl, linkurl);
}
});
};
// Below this is the Ajax Trigger
$("#nav ul li a").click(function(){
var linkurl = $("#nav ul li a").attr("href");
ajaxLinkPage(linkurl);
$('#dvLoading').css('display','block');
});
아약스 링크 .click()에 event.preventDefault를 입력하면 호출이 작동하지 않습니다.
일부 페이지에서는 크롬으로 작동하지만 사파리에서는 전혀 작동하지 않습니다.
고마워요!
initialPoop ... :) – smerny
메신저 똥 싸고 그냥이 – danronmoon
그냥 거짓 수익을 추가 읽기; 귀하의 클릭 이벤트에. – Tyr