Please tell everybody on how to support different languages using AJAX. I've been searching this for a long time in many forums in the internet but they did not solved or post the definite solutions.
Here's the printscreen: (please do copy and paste if not displayed here.)
output via php and html (http://anime.geocities .jp/rozvinbm_jp/shops.JPG)

output via php, html and processed with Ajax (http://anime.geocities .jp/rozvinbm_jp/shopsajax.JPG)

In addition, here is my code to explicitly defined the encoding:
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http:?//www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_j is">
......[/HTML]
Here's the printscreen: (please do copy and paste if not displayed here.)
output via php and html (http://anime.geocities .jp/rozvinbm_jp/shops.JPG)
output via php, html and processed with Ajax (http://anime.geocities .jp/rozvinbm_jp/shopsajax.JPG)
In addition, here is my code to explicitly defined the encoding:
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http:?//www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_j is">
......[/HTML]
Code:
var xmlHttp;
var m_placeholder;
function executeProcess(serverscriptfile, placeholder, posts) {
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
m_placeholder = placeholder;
var url=serverscriptfile;
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("POST", url, true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=Shift-JIS'");
xmlHttp.send(posts);
}
function stateChanged() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(m_placeholder).innerHTML=xmlHttp.responseText;
}
}
function GetXmlHttpObject() {
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
Comment