Forum Moderators: open

Message Too Old, No Replies

Escape Characters!

         

geoapa

8:56 pm on Nov 6, 2003 (gmt 0)

10+ Year Member



I'm having trouble outputing an ssi include through document.write

I've tried placing escape characters before the quotation marks in the parameter for the .write function but it won't work.

here it is without the escape characters:

document.write("<!--#include file="ssi/flash1.html" -->");

DrDoc

9:00 pm on Nov 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, the problem is that the SSI won't ever be parsed.

SSIs are parsed server side, but the JavaScript isn't parsed till client side, hence after the possibility of using any server side includes.

geoapa

9:07 pm on Nov 6, 2003 (gmt 0)

10+ Year Member



ahh, gotcha. thanks.

So I'll have to include the actual code from the SSI file into the document.write() function.

Is there way to output a block of HTML code in JS without having to declare document.write() for each line?

DrDoc

9:31 pm on Nov 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can put all the tags on one line...

If you want:
<p>
Some text here
<a href="#>Link</a>
</p>

You can just do:
document.write('<p>Some text here <a href="#">Link</a> </p>');