Насколько мое исследование (2 дня!!!) показало, что мне нужно поместить его в раздел beforeSend, что я сделал следующим образом:
Код: Выделить всё
$(document).ready(function(){
$('.content').load('home.html'); //by default initally load text from boo.php
$('#navlist a').click(function() { //start function when any link is clicked
$(".content").slideUp("slow");
var content_show = $(this).attr("title"); //retrieve title of link so we can compare with php file
$.ajax({
method: "load",url: ""+content_show,
beforeSend: function(){
XMLHttpRequest.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
$("#loading").show("fast");
}, //show loading just when link is clicked
complete: function(){ $("#loading").hide("fast");}, //stop showing loading when the process is complete
success: function(html){ //so, if data is retrieved, store it in html
$(".content").show("slow"); //animation
$(".content").html(html); //show the html inside .content div
}
}); //close $.ajax(
}); //close click(
}); //close $(
Код: Выделить всё
setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
Веб-сайт можно просмотреть по адресу 43dennis.co.nr/bivakas. По сути, он загружается с кучей квадратных черных вопросительных знаков вместо букв со специальными акцентами.
Большое спасибо за помощь.
Подробнее здесь: https://stackoverflow.com/questions/317 ... set-header
Мобильная версия