Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Ajax] Polskie znaki
Lirdoner
post 25.12.2010, 16:23:33
Post #1





Grupa: Zarejestrowani
Postów: 500
Pomógł: 1
Dołączył: 29.09.2009

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


Witam, mam problem z polskimi znakami w tekście który jest przysyłany ajaxem do pliku php
Szukałem pomocy w google ale tam pisało że wystarczy dodać nagłówek

header("Content-Type: text/html; charset=iso-8859-2");

w odpowiednim kodowaniu, niestety w moim przypadku to nie pomaga
[JAVASCRIPT] pobierz, plaintext
  1. function sendChat(text){
  2. var dataString = 'function=send&message='+text;
  3. $.ajax({
  4. type: "POST",
  5. url: "functions/process.php",
  6. data: dataString,
  7. success: function(html){
  8. $("#error").html(html);
  9. updateChat();
  10. },
  11. });
  12. }
  13.  
  14. $(function() {
  15. // watch textarea for release of key press
  16. $('#sendie').keyup(function(e) {
  17.  
  18. if (e.keyCode == 13) {
  19.  
  20. var text = $(this).val();
  21. var maxLength = $(this).attr("maxlength");
  22. var length = text.length;
  23.  
  24. // send
  25. if (length <= maxLength + 1) {
  26. sendChat(text);
  27. $(this).val("");
  28.  
  29. } else {
  30.  
  31. $(this).val(text.substring(0, maxLength));
  32.  
  33. }
  34.  
  35.  
  36. }
  37. });
  38.  
  39. });
[JAVASCRIPT] pobierz, plaintext

Plik php tylko wprowadza dane do bazy

Ten post edytował Lirdoner 25.12.2010, 16:24:05
Go to the top of the page
+Quote Post

Posty w temacie


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 Wersja Lo-Fi Aktualny czas: 18.07.2025 - 14:54