473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Langauge Issue with DOM

Hi,

I want to display some germen text in my site.
and it is coming well when i have given content="text/html;
charset=utf-8" in meta Tag

But when i takes some data (as HTML) from server through AJAX and
insert it into a Div using innerHTML property,the characters are not
displaying well

Please help to find some solution

Regards,
Anees
Feb 22 '08 #1
5 1161
On Feb 22, 1:48 pm, Anees <muhd.an...@gmail.comwrote:
Hi,

I want to display some germen text in my site.
and it is coming well when i have given content="text/html;
charset=utf-8" in meta Tag

But when i takes some data (as HTML) from server through AJAX and
insert it into a Div using innerHTML property,the characters are not
displaying well

Please help to find some solution

Regards,
Anees
The page answering AJAX call should specify charset too...
Feb 22 '08 #2
Anees wrote:
But when i takes some data (as HTML) from server through AJAX and
insert it into a Div using innerHTML property,the characters are not
displaying well
Make sure your server-side code sends a HTTP Content-Type header with a
proper charset parameter e.g.
Content-Type: text/plain; charset=UTF-8
The charset parameter value to use depends entirely on how the data is
encoded, UTF-8 is just an example.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Feb 22 '08 #3
Make sure your server-side code sends a HTTP Content-Type header with a
proper charset parameter e.g.
Content-Type: text/plain; charset=UTF-8
I have added the line

header("Content-type: text/html; charset=UTF-8");

in my PHP server side file..
but still am not getting the characters right!!!
Feb 23 '08 #4
SAM
Anees a écrit :
Hi,

I want to display some germen text in my site.
and it is coming well when i have given content="text/html;
charset=utf-8" in meta Tag

But when i takes some data (as HTML) from server through AJAX and
insert it into a Div using innerHTML property,the characters are not
displaying well
In what charset are your html datas encoded ?

With which browser(s) does that happens ?

With my tries about Ajax on a server that does'nt send charset headers
I use only files written (coded ?) in utf-8

I have same problem as yours with files in utf-8 only with Safari which
wants absolutely to read them in iso-8859-1.
For him I inserts the xml declaration on top of files to call :
<?xml version="1.0" encoding="utf-8"?>
and that seems to fix the question.
--
sm
Feb 23 '08 #5
With my tries about Ajax on a server that does'nt send charset headers
I use only files written (coded ?) in utf-8

First i have set the header in the to of PHP action file
header("Content-type: text/html; charset=UTF-8");
but it doesnt take any effect

Then i removed it and i converted all my data with
utf8_encode($germ_data);
Now it is working well..
I have same problem as yours with files in utf-8 only with Safari which
wants absolutely to read them in iso-8859-1.
For him I inserts the xml declaration on top of files to call :
<?xml version="1.0" encoding="utf-8"?>
and that seems to fix the question.
i am just getting whole the data from the server with responseText
and keeping all the data in a DIV with InnerHTML property..
So does i need to go for
<?xml version="1.0" encoding="utf-8"?>
in the page top?
Feb 25 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
2
by: Anthony Cuttitta Jr. | last post by:
We have an application that outputs several different graphs from data downloaded from our AS400. The application has worked without (this) issue for several months now, but just recently, the...
2
by: Ben Rush | last post by:
Hello World, Okay, I have spent the day browsing the newsgroups and reading up on article after article concerning ViewState corruption and so forth, and I have a couple questions. We...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
2
by: ahmed ahmed | last post by:
VB.NET hi i'm asking about How To Change System Keyboard langauge from the VB.NET or Keyboard langauge from langauge to another without the API function. and thanks about helping me. ***...
1
by: Dennis Gearon | last post by:
I'd like to get people's feelings about the topic. At one extreme is to use table locking and external language queries to even do referential integerity - a la Old (present?) MySQL/PHP. A more...
2
yoda
by: yoda | last post by:
i was wondering what langauge should i use to make a game for the computer. what do you suggest Like C++ or VB or VBA thanks a lot Yoda
1
by: thembinkosi | last post by:
Hi I have done SCJP and at the moment I'm doing web development using Servlet and JSP's. I'm interested in doing another langauge after java but I don't know which is the right one to do. ...
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
2
by: ARAVINDRNR | last post by:
How to change an unsigned char array to bit map file in 'C' langauge
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.