Problem dealing with double quotes in InnerHTML

M

Mahernoz

Hi Friends,

I have some problem here. I am using Asp.net 2.0 but that is not
relevant to my Question.

I have a <div> tag.
<div id="dvAArea" runat="server"></div>

and an HiddenField

<input type="hidden" runat="server" id="hidAArea" />

on click of a button i have a function

function CopyHTML()
{
document.getElementById('<%= hidAArea.ClientID %>').value
= MakeXMLParseable(document.getElementById('<%= dvAArea.ClientID
%>').innerHTML);

}

the problem here is i want to make the html of dvAArea Xml compatible.
but i am finding that the innerHTML property removes the double quotes
in IE6.

And as this removal occurs i cannot load it as a validXml (which is
used for other purpose).


putted simply i am finding trouble using innerHTML property with
Internet Explorer as it removes the "double quotes" from my rendered
html.
i am just looking for a way so that the double quotes are not removed
when innerHTML is called in Internet Explorer (mozilla works fine).


Regards,
Mahernoz
 
M

Manuel Ricca

Hello Mahernoz,

Maybe I'm missing the point here but why don't you just use normal
HTML character codes? A quotation mark is represented by &quot;
You can also use &ldquo; and &rdquo; if you want left and right double
qutoation marks.


Manuel Ricca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top