S
servandomontero
I have a simple AJAX script that sends and retrieves a text file. The
ajax function is called from index.html
....
var obj = document.getElementById(objID);
xmlHttp.open("GET", "testing.txt", true);
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
obj.innerHTML = xmlHttp.responseText;
}
}
xmlHttp.send(null);
....
The script works OK. I can see the 'testing.txt' file just fine. The
issue is that the file (testing.txt) contains spanish character like:
í, á
and i see this ? instead of those spanish characters.
This is my syntax in my index.html:
....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample 2_1</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
....
What's wrong?
Is this a server issue? Coz' i'm hosting with Yahoo and i dont have
access to change the configuration of the server, obviously.
Please Help
sm
ajax function is called from index.html
....
var obj = document.getElementById(objID);
xmlHttp.open("GET", "testing.txt", true);
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
obj.innerHTML = xmlHttp.responseText;
}
}
xmlHttp.send(null);
....
The script works OK. I can see the 'testing.txt' file just fine. The
issue is that the file (testing.txt) contains spanish character like:
í, á
and i see this ? instead of those spanish characters.
This is my syntax in my index.html:
....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample 2_1</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
....
What's wrong?
Is this a server issue? Coz' i'm hosting with Yahoo and i dont have
access to change the configuration of the server, obviously.
Please Help
sm