我想設置的字符集的jQuery的電話,我使網站是一個立陶宛朋友因此有一些信件,口音等的jQuery/AJAX設置的字符集頭
據我的研究,到目前爲止( 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查看基本上它加載了一堆方形黑色問號代替具有特殊口音的字母。
非常感謝您的幫助。
哦..無論使用哪種XMLHttpRequest.setRequestHeader或只是setRequestHeader函數甚至不工作...對不起忘了提, – nicky 2010-07-04 15:11:40