On Mon, 29 Sep 2003 10:05:18 +0100, Steve Pugh <st***@pugh.net> wrote:
Jane Withnolastname <Ja**********************@yahoo.com> wrote:
How can I include a file using JavaScript?
document.write('<!--#include file="myfile.htm" -->')
won't work because of the commenting.
Uh no. It won't work because JavaScript is handled by the browser and
SSIs are handled by the server. So by the time the JavaScript is
parsed it is far too late for the SSI to be parsed.
It may help if you gave a bit more background. Why does this file need
to be included by JavaScript, why can it not just be included once?
Steve
OK.
When I list something on eBay, I add it to my web page. That's easy.
But I don't want to have to be there and on the ball in order to take
it off my web page when the auction ends. Therefore, I use a
JavaScript to "expire" it at the proper time.
If the auction is not over, the script shows the iFrame. If the
auction is over, it reverts to just an eBay button (which is what
noscript browsers see anyway).
Ideally, I want to rid myself of iFrames, but without SSI, I cannot
figure out how to get another page into my main page.
Maybe I'm asking for the impossible. If that's the case, I guess I'm
stuck with the iFrames - which I hate just as much as everyone else
here!
Thanks.