Alex Rivera | Logout

Appending HTML to end of body using javascript

Asked 2010-03-21T21:08:35.873
16

I have several templates for faceboxes (lightbox) that I need at different points of the application. These are stored in different partials and files.

I will initialize different javascript functions in accordance to which ones I need. The question is, what is the best way to append the external HTML page into my body using javascript?

Edit
Report

1 Answer

0

the easy way with jQuery is:

$('#result').load('test.html');

<div id="result"><!--/ Hold My Data! /--></div>

obviously you can change #result with body

answered 2010-03-22T02:26:39.700

Your Answer