Adding HTML to the DOM through the client.

Posted by Mantorok on Stack Overflow See other posts from Stack Overflow or by Mantorok
Published on 2010-04-01T10:39:23Z Indexed on 2010/04/01 10:43 UTC
Read the original article Hit count: 323

Filed under:
|
|

Hi all

Just wanted your views on the most efficient way to render content on demand, the reason this has come to light is that I'm maintaining a AA compliant website and we recently added video to it, and one of the techniques to avoid invalidation was to add the HTML for the video to the DOM after the page has loaded - which is fine and working ok.

However, I found 2 possible techniques and I would appreciate some views, the one I'm currently using is an AJAX call that returns the HTML, the other technique is a hidden field that contains the HTML - I'm presently using the former.

The main reason I'm asking the question is because there may be times when this particular control is also requested via an AJAX call, so I would end up with back-to-back AJAX calls, which seems a bit inefficient to me.

I hope this makes sense, are there any better techniques to achieve this? Am I worrying too much over the consecutive AJAX calls?

Thanks

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about w3c