Witam.
Mam taki kod:
function showInfo(str)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("positive").innerHTML=xmlhttp.responseText;
$('.info').fadeIn('slow', function() { });
}
}
var tyt = document.getElementById('tytul').value;
var tr = document.getElementById('tresc').value;
var queryString = "id=" + str + "&tytul=" + tyt + "&tresc=" + tr;
xmlhttp.open("POST","positive.php",true);
xmlhttp.overrideMimeType('text/html; charset=UTF-8');
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", queryString.length);
xmlhttp.send(queryString);
}
oraz
<?
$id=$_POST['id'];
echo '<div class="info"><img src="tick.png"> News od id '.$id.' został zaktualizowany</div>'; ?>
Pojawia się div i wartości $_POST['...']. Wszystko działa lecz problem jest następujący - wywala mi jakieś nie polskie znaczki. Oto SS:
(IMG:
http://img214.imageshack.us/img214/9880/bladj.jpg)
Próbowałem z windows-1250 ale efekt jest odwrotny. Div jest dobry, lecz wartości z POST są z japońskimi znaczkami.