Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [JavaScript]Automatyczne odświezanie jednego elementu
nowy16
post
Post #1





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 29.08.2009

Ostrzeżenie: (0%)
-----


Witam! Na stronie mam czat zrobiony w php. W oknie wyświetlającym wypowiedzi osób dałem automatyczne odświeżanie w js. Mój problem polega na tym, że na stronie czatu nie pojawiają mi się polskie litery, natomiast w pliku okno.php, gdzie są rozmowy one są. Może ktoś wie w czym jest problem. Podaję skrypt odświezania:

  1.  
  2.  
  3. function send(event) {
  4. event = (event)?event:((window.event)?event:null);
  5. if (event.keyCode==13) document.formularz.submit();
  6. }
  7.  
  8. var vUri = 'okno.php'
  9.  
  10.  
  11. var vRequest;
  12.  
  13. function getRequest()
  14. {
  15. vRequest = null;
  16.  
  17. if (window.XMLHttpRequest)
  18. {
  19. vRequest = new XMLHttpRequest();
  20. }
  21. else if (window.ActiveXObject)
  22. {
  23. try
  24. {
  25. vRequest = new ActiveXObject('Msxml2.XMLHTTP');
  26. }
  27. catch (err)
  28. {
  29. try
  30. {
  31. vRequest = new ActiveXObject('Microsoft.XMLHTTP');
  32. }
  33. catch (err)
  34. {
  35. return (false);
  36. }
  37. }
  38. }
  39.  
  40. vRenew = new Date();
  41.  
  42. vTest = /\?/;
  43.  
  44. vNewUri = vUri + (vTest.test(vUri)?'&':'?') + 'renew=' + vRenew.getTime();
  45.  
  46. vRequest.onreadystatechange = catchChange;
  47. vRequest.open('GET', vNewUri, true);
  48. vRequest.send(null);
  49. }
  50.  
  51. function catchChange()
  52. {
  53. if (vRequest.readyState == 4 && vRequest.status == 200)
  54. {
  55. document.getElementById('i_reload').innerHTML = vRequest.responseText;
  56.  
  57. setTimeout('getRequest()', 2000);
  58. }
  59. }
  60.  
  61. getRequest();


Ten post edytował nowy16 17.07.2010, 13:42:27
Go to the top of the page
+Quote Post
Pawel_W
post
Post #2





Grupa: Zarejestrowani
Postów: 1 675
Pomógł: 286
Dołączył: 15.06.2009
Skąd: Wieliczka

Ostrzeżenie: (0%)
-----


rozbieżne kodowanie obu plików? smile.gif
Go to the top of the page
+Quote Post
nowy16
post
Post #3





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 29.08.2009

Ostrzeżenie: (0%)
-----


Tak. A zapomniałem dodać, że tylko ęćń działa.

Ten post edytował nowy16 17.07.2010, 13:51:10
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 10:01