nikander89
New Member
- Регистрация
- 13.07.2008
- Сообщения
- 7
Имеется страница, но русские символы отказывается выводить....как решить эту проблему??
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> </title>
</head>
<table width="100%" border = 2 align="center">
<thead>
<TH></TH><TH></TH>
</thead>
<script language="JavaScript">
/**
* IBM developerWorks: Mastering Ajax, Part 1: Introduction to Ajax
* [http://www.ibm.com/developerworks/web/library/wa-ajaxintro1.html]
*/
/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
xmlHttp = false;
}
}
@end @*/
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest();
}
function updatePage() {
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
var row, rows = response.split('\n');
var i, j, tbody = '';
for (i = 0, j = rows.length; i < j; ++i) {
row = rows.split('|');
tbody += '<tr>';
tbody += '<td>' + row[0] + '</td>';
tbody += '<td>' + row[1] + '</td>';
tbody += '</tr>';
}
document.getElementById('table').innerHTML = tbody;
}
}
function callServer() {
// Open a connection to the server
xmlHttp.open("GET", "./text.txt", true);
// Setup a function for the server to run when it's done
xmlHttp.onreadystatechange = updatePage;
// Send the request
xmlHttp.send(null);
}
callServer();
</script>
<tbody id="table"></tbody>
</table>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> </title>
</head>
<table width="100%" border = 2 align="center">
<thead>
<TH></TH><TH></TH>
</thead>
<script language="JavaScript">
/**
* IBM developerWorks: Mastering Ajax, Part 1: Introduction to Ajax
* [http://www.ibm.com/developerworks/web/library/wa-ajaxintro1.html]
*/
/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
xmlHttp = false;
}
}
@end @*/
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest();
}
function updatePage() {
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
var row, rows = response.split('\n');
var i, j, tbody = '';
for (i = 0, j = rows.length; i < j; ++i) {
row = rows.split('|');
tbody += '<tr>';
tbody += '<td>' + row[0] + '</td>';
tbody += '<td>' + row[1] + '</td>';
tbody += '</tr>';
}
document.getElementById('table').innerHTML = tbody;
}
}
function callServer() {
// Open a connection to the server
xmlHttp.open("GET", "./text.txt", true);
// Setup a function for the server to run when it's done
xmlHttp.onreadystatechange = updatePage;
// Send the request
xmlHttp.send(null);
}
callServer();
</script>
<tbody id="table"></tbody>
</table>
</html>