PhotoDune

JS Html render problem please help!

393 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
phantasmagoria says

Hi Friends;

I am using ajax for getting some information from my database and trying to put the collected information to my page via javascript.

The problem i am having is, although i succesfully collect the data and put it to my page, i cant manage the page to render the collected HTML tags properly.

The tags are visible and readable on the page as <p>some text</p> <br /> etc. but they are not rendered.

Is there anybody that can help me?

296 posts
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 1 000 and 5 000 dollars
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • United Kingdom
theninja says

There’s not much we can do without seeing some code, are you using a JavaScript library? :delicious:
By the sounds of things you’re either using createTextNode() rather than innerHTML, which means your Ajax response isn’t being parsed as html but just plain text OR the html is being converted into it’s html entity equivalent before being stored in your database (htmlentities/htmlspecialchars could be the culprit if you’re using php).

393 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
phantasmagoria says

ok mate i found the problem. I am using scriptaclous and i was dynamically adding a div that contains another divs with Builder.node function. When i dynamically pass the variables in Bulder.node, i was having problems with the rendering. Instead, now i am creating the node as always and attaching the related content to the node with innerHTML. That fixed the problem.

Thanks anyway.

by
by
by
by
by