in reply to Telling a file included in a web page something

Hi lishevita,

Well, this is really off-topic - this isn't a perl question so much as an apache question.

The first thing you need to clear up is some misconceptions about what executes where. Your <!-- #include --> is a server-side include (SSI) - in other words, it executes on the server. Your proposed fix - which is certainly the right kind of thinking - won't work because Javascript executes on the client side, in the browser, long after the response has left the server (and thus the SSI handler).

You can learn a lot more about SSI from http://httpd.apache.org/docs/2.2/howto/ssi.html. It sounds like you don't have control over the webserver, and you don't have privileges to execute anything on the webserver. In other words, if you can't execute file.pl as a CGI on its own, you certainly won't be able to include its output via SSI. So, you just won't be able to do anything dynamic on the server end.

And thus you may be barking up the right tree with the Javscript. Just drop the SSI. Why not have the main page load, read the requested project from its own URL, somehow(*) fetch the contents of the project using Javascript, and then write the contents using document.write statements.

(*) Therein lies the rub. Here's a few ways.
  1. Use IFRAME tags. Only supported by IE.
  2. Make your page a frameset, and make one frame have zero width; then load your auxilary content in the spare frame. Some browsers won't allow a zero-width frame.
  3. Like the frameset approach, but use window.open to make popup windows and load the content there. Of course, pop-up blockers will snare you.
There is no perfect solution this way; each involves ome trade-offs. Anyway, my $0.02 . Good luck.