Forum Moderators: open

Message Too Old, No Replies

Posting HTML In JavaScript?

         

Ryan Holiday

4:01 am on Sep 8, 2005 (gmt 0)

10+ Year Member



Is it possible to post this bit of ssi code

<!--#include file="INSERT ACTUAL FILENAME HERE.html" -->

into a js page?

ie. the document.write('') format?

If so, how?

Rambo Tribble

4:46 am on Sep 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Server side includes happen at the server. All JavaScript takes place at the client. XMLHttpRequest is probably as close as you will come to a fairly pure JavaScript call for an outside file. Iframes (sometimes called HTML includes) can be used to incorporate content from external HTML files and the content can be loaded by scripts. The apparent advantage to XMLHttpRequest is reduced overhead compared to downloading HTML.