syntax for include file

Does anybody know the correct syntax to use an "include" file within javascript? Based on a value I would like to include an html program. In the code below, where it says case 401, I can't seem to get the syntax right no matter what I try. I have tried document.writeln in front of the include, I've tried just about everything I can think of. Any help is appreciated.

Originally posted by Eric Pascarello: JavaScript does not have a include. That is normally done with the server. Best thing you can do would be to add an iframe to the page and set the iframe's source.

Eric

cara dastoli
Greenhorn

Joined: May 22, 2007
Posts: 13

posted Jul 13, 2007 04:58:00

0

Originally posted by cara dastoli: [QB]Hi,

Thank you. I used the Iframe which worked, however, I would like to display the output on the same page as my original program. How is this possible? Is there an alternative to document.write? My function code is as follows: