Loading ...
Sorry, an error occurred while loading the content.

I don't understand this behavior

Expand Messages
  • davidfealkoff
    If I have simple structure: and I write the following code: document.getElementById( test )innerHTML= Testing
    Message 1 of 1 , Aug 4, 2009
      If I have simple structure:
      <div id="test"><div>

      and I write the following code:
      document.getElementById('test')innerHTML='Testing <STRONG><font style="COLOR: #c00000; FONT-FAMILY: ">HTML visual text</font></STRONG>'

      This works exactly as I expect displaying colored bold text where it's supposed to.

      If I use asynchRequest and download the same string in JSON format, use the YAHOO JSON.parse command and I write the following:

      document.getElementById('test')innerHTML= text[i].title;
      where text[i].title is one record in the database whose value is exactly the same as in the hard coded example i.e.
      Testing <STRONG><font style="COLOR: #c00000; FONT-FAMILY: ">HTML visual text</font></STRONG>

      However in this case I just get the string exactly as it's written instead of the proper display.

      Can anyone explain this behavior and how I can fix it?
    Your message has been successfully submitted and would be delivered to recipients shortly.