Puste responsetext XmlHttp (tylko Google Chrome)
Mam problem z moim skryptem czatu w Google Chrome. Czasami responsetext jest pusty, dopóki nie przeładujesz strony, ale czasami działa dobrze. Otwiera połączenie xmlhttp co sekundę, a jeśli pierwsze dobre, to również po tym dobre. W Firefoksie zawsze jest dobrze.
var url = "text.php";
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = myfunc;
xmlHttp.send(null);
function myfunc()
{
if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
{
var msg = xmlHttp.responseText;
alert(msg);
}
}