Personal tools

Sep 15, 2011

Rendering of HTML using innerHTML or .update() method with Javascript

By manipulating an element's innerHtml you'll be able to change your text and HTML as much as you like. But, pay attention!!!

These methods are very useful if you want to pupulate div's in your page, but at the end rendering would be strange.

Problem is that HTML that you produce in some way (e.g. agents in Lotus Domino) must be well-formatted and valid before you put it into your <div>

For example, if you want to put an image and you write:

<img src="<somePath>" alt="" border=0 />

instead of

<img src="<somePath>" alt="" border="0" />

(notice the presence of "" in attribute border), first way could generate rendering HTML problems.

 Same behaviour if HTML TAG are not correctly nested.


Filed under: ,
comments powered by Disqus