Problem dealing with double quotes in InnerHTML

Discussion in 'ASP .Net' started by Mahernoz, Dec 11, 2007.

  1. Mahernoz

    Mahernoz Guest

    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
    Mahernoz, Dec 11, 2007
    #1
    1. Advertising

  2. Mahernoz

    Manuel Ricca Guest

    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


    On Dec 11, 7:40 am, Mahernoz <> wrote:
    > 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
    Manuel Ricca, Dec 11, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris White

    Quotes/Double Quotes in Image Control

    Chris White, Sep 22, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,829
    Hermit Dave
    Sep 22, 2004
  2. Chris
    Replies:
    1
    Views:
    13,602
    Oisin
    Mar 24, 2006
  3. Sydex
    Replies:
    12
    Views:
    6,449
    Victor Bazarov
    Feb 17, 2005
  4. jOhn
    Replies:
    1
    Views:
    210
    Phlip
    Jan 29, 2008
  5. Mahernoz
    Replies:
    19
    Views:
    453
    Mahernoz
    Dec 15, 2007
Loading...

Share This Page