[Linux-programlama] Ajax - türkçe karakter problemi

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Ahmet (corsairsoft@hotmail.com)
Date: Wed 06 Dec 2006 - 11:23:47 GMT


Merhabalar,

ilk Ajax denememde türkçe karakter problemi ile karşılaştım :(

denediğim örneği aşağıda 3 dosya şeklinde gönderiyorum.

// index.php dosyası

<html>
<head>
 <title>Ajax Deneme</title>
 <meta http-equiv="content-type" content="text/html; charset=iso-8859-9" />
 <script language="JavaScript" type="text/javascript">
 var http;
 var browser = navigator.appName;
 oXMLHttpRequest()

 function oXMLHttpRequest() {
   var obj;
  try {
    // Sadece Internet Explorer için
    http = new ActiveXObject('Microsoft.XMLHTTP');
  }
  catch(e) {
    try {
   // Gecko tabanlı, safari ve de Opera için
   http = new XMLHttpRequest();
    }
    catch (e) {
   // XMLHttpRequest destegi yoksa
   http = false;
    }
  }
  return http;
 }

 function Goster(sayfa){
  document.getElementById("goster").innerHTML="Lütfen bekleyiniz.. Veriler alınıyor.."
  var url=sayfa
  http.open('get', url);
  http.onreadystatechange = icerikdegisim;
  http.send(null);
 }

 function icerikdegisim(){
  if(http.readyState == 4){
    document.getElementById('goster').innerHTML = http.responseText;
   } else {
   // işlem devam ediyor
  }
 }
 </script>

</head>
<body>
<br />
<br />
<br />
<br />

<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
     <a href="javascript:Goster('icerik.php');">İçerik</a> &nbsp;-&nbsp;
     <a href="javascript:Goster('icerik.php');">İçerik</a>
 </td>
  </tr>
</table>

<br>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td id="goster"></td>
  </tr>
</table>
</body>
</html>

//icerik1.php dosyası

<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-9" />
 </head>
</html>
<body>

İçerik 1
<br />
Türkçe karakterler : ü.i.ğ.ş.ç.ö.ı.Ü.İ.Ğ.Ş.Ç.Ö.I.<br />
</body>
</html>

//icerik2.php dosyası

<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-9" />
 </head>
</html>
<body>
İçerik 2
<br />
Türkçe karakterler : ü.i.ğ.ş.ç.ö.ı.Ü.İ.Ğ.Ş.Ç.Ö.I.<br />
</body>
</html>

Kolay gelsin iyi çalışmalar...

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.