aika Posted October 26, 2008 Report Share Posted October 26, 2008 ir input fields <input type="text" name="msg" size="16" id="msg" > <button onclick="doWork();">⏎</button> un funkcija: function doWork(){ httpObject = getHTTPObject(); if (httpObject != null) { link = "chat/message.php?nick="+nickName+"&msg="+document.getElementById('msg').value; httpObject.open("GET", link , true); httpObject.onreadystatechange = setOutput; httpObject.send(null); } } message.php būtiskās rindas ir: $f = fopen('msg.html',"a+"); $msg = isset($_GET['msg']) ? htmlspecialchars($_GET['msg']) : "."; fwrite($f,$line."\r\n"); uz FF viss ok, bet IE ievadot latviešu burtus rāda kvadrātus un citas muļķības! piemēram š atgriež:�pan> utt viss kods gan message.php nokodēts uz UTF-8 kādas idejas? Link to comment Share on other sites More sharing options...
bubu Posted October 26, 2008 Report Share Posted October 26, 2008 http://php.lv/f/index.php?s=&showtopic...ost&p=20172 Link to comment Share on other sites More sharing options...
aika Posted October 26, 2008 Author Report Share Posted October 26, 2008 http://php.lv/f/index.php?s=&showtopic...ost&p=20172 nu nokodēt sanāk! Bet atpakaļ dabūt - nē! kurā vietā es varu ielikt unescape?: function doReload(){ httpObject = getHTTPObject(); var randomnumber=Math.floor(Math.random()*10000); if (httpObject != null) { link = "chat/message.php?all=1&rnd="+randomnumber; httpObject.open("GET", link , true); httpObject.onreadystatechange = setAll; httpObject.send(null); } } Link to comment Share on other sites More sharing options...
bubu Posted October 26, 2008 Report Share Posted October 26, 2008 setAll funkcijā, ja tā saņem datus atpakaļ no skripta. Link to comment Share on other sites More sharing options...
aika Posted October 27, 2008 Author Report Share Posted October 27, 2008 setAll funkcijā, ja tā saņem datus atpakaļ no skripta. function setAll(){ if(httpObject.readyState == 4){ var response = httpObject.responseText; var objDiv = document.getElementById("result"); objDiv.innerHTML = response; objDiv.scrollTop = objDiv.scrollHeight; } } mēģināju gan var objDiv = unescape(document.getElementById("result")); gan objDiv.innerHTML = unescape(response); :( nepalīdz ... ehh Link to comment Share on other sites More sharing options...
Recommended Posts