1

I have this...portion of code in Javascript:

 var description = document.createElement('P');

 description.className='rssBoxDescription';

 description.innerHTML = itemTokens[2];

 div.appendChild(description);

I see that description gets the HTML value and displays as plain HTML coding not as HTML processing it shouldbe ... how to convert this HTML value in description to be appended to div element shown as HTML...which is not showing.

Also it has value something like:

<table><tr><td style="padding: 0 5px"><ahref="xttp://picasaweb.google.com/linktoimagepage"><imgtag style="border:1px solid #5C7FB9" s_rc="xttp://lh3.ggpht.com/imagepath" alt="image.jpg"/></a></td><td valign="top"><font color="#6B6B6B">Date: </font><font color="#333333">Jun 28, 2007 9:00 AM</font><br/><font color=\"#6B6B6B\">Number of Comments on Photo:</font><font color=\"#333333\">0</font><br/><p><ahref="xttp://picasaweb.google.com/linktoimage"><font color="#3964C2">View Photo</font></a></p></td></tr></table>

Pls help Anita

@SARFARAZ ... YES...I am using the script on dhtmlgoodies.com/scripts/rss-scroller/js/ajax.js

It worked as :
description.replace(/&amp;lt;/g,"<");
and
description.replace(/&amp;gt;/g,">");

1
  • is your div also created using createElement (div.appendChild(description))? Commented May 20, 2010 at 6:29

2 Answers 2

1

It could be that the > and the < have been encoded like &gt; and &lt;

Try replacing &gt; with > and &lt; with < in itemTokens before assigning it as the DIV innerHTML and see if it works

Sign up to request clarification or add additional context in comments.

Comments

0

It seems to be working for me. Try posting entire code including the div that is created dynamically.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.