function openURL(href){
var link = href; //$(this).attr('href');
$.ajax({
url: link,
type: 'POST',
cache: false,
success: function (result) {
$('#target').html(result);
$.validator.unobtrusive.parse($("form#ValidateForm"));
}
});
window.history.pushState({href: href}, '', href);
}
$(document).ready(function() {
$(document).on('click', 'a', function () {
openURL($(this).attr("href"));
return false; //intercept the link
});
window.addEventListener('popstate', function(e){
if(e.state)
openURL(e.state.href);
});
});
Hiển thị các bài đăng có nhãn jquery Link. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn jquery Link. Hiển thị tất cả bài đăng
Thứ Bảy, 5 tháng 8, 2017
jquery ajax window history pushstate
Đăng ký:
Bài đăng (Atom)