S
SM
Hello,
I have a index.html file with 3 links and one div.
Each link refers to and html file (1.html, 2.html, and 3.html).
Using AJAX, i upload the HTML file (depending on which link the users
click) into the div.
That makes for a perfect no-refresh web page, very user-friendly, very
blablabla bla...
You know what i mean.
This is my problem:
Those weird characters don't show up correctly! I mean the characters
with accent like: á é í ó ú ...
Why? and how do i fix that small problem?
Two more related questions:
1
For the the html files (1.html, 2.html, and 3.html), do i need to
insert tha <HEAD> and <HTML> or can i just insert
<BODY>. The reason im asking, is that i only use the <BODY> content to
upload in a div.... i dont think i need the rest...just asking...
2
Is this the best way to achieve this? I've read in this forum that a
php that calls a html file or something like that is also a
good solution.
Thanks
Marco
--------------
If it helps, this is how i insert the html file (1.html, 2.html, and
3.html) to the main div of the index.html
/*-----------------------------------------------------*/
function display()
{
var div = document.getElementById('main');
var xmlResponse = xmlHttp.responseText;
div.innerHTML = xmlResponse;
}
I have a index.html file with 3 links and one div.
Each link refers to and html file (1.html, 2.html, and 3.html).
Using AJAX, i upload the HTML file (depending on which link the users
click) into the div.
That makes for a perfect no-refresh web page, very user-friendly, very
blablabla bla...
You know what i mean.
This is my problem:
Those weird characters don't show up correctly! I mean the characters
with accent like: á é í ó ú ...
Why? and how do i fix that small problem?
Two more related questions:
1
For the the html files (1.html, 2.html, and 3.html), do i need to
insert tha <HEAD> and <HTML> or can i just insert
<BODY>. The reason im asking, is that i only use the <BODY> content to
upload in a div.... i dont think i need the rest...just asking...
2
Is this the best way to achieve this? I've read in this forum that a
php that calls a html file or something like that is also a
good solution.
Thanks
Marco
--------------
If it helps, this is how i insert the html file (1.html, 2.html, and
3.html) to the main div of the index.html
/*-----------------------------------------------------*/
function display()
{
var div = document.getElementById('main');
var xmlResponse = xmlHttp.responseText;
div.innerHTML = xmlResponse;
}