View Full Version : can I combine javascript with SSI

isabel ringing
04-07-2003, 09:01 PM
Can I combine Server Side Includes with javascript? I have a calendar of events which displays 3 months of the year at a time. I would like to save each upcoming month's info as an SSI (eg: june.incl) to be loaded into the main page as part of a table when that month starts. I'd like to use javascript to signal the beginning of the month and then the SSI would be invoked. Even better would be if I could remove the previous month at the same time. Can this be done, or is there a better way using just javascript?

04-08-2003, 08:18 PM
You want each month to be a separate file to save loading them all? Well you can't document.write an SSI include (... or rather you can .. but it's a nightmare; don't go there ....)

I reckon you could do it by making separate files, like:


and so on, and then do a conditional document.write with those; like a file called "calendar.js", and inside that you have something like

var monthSrc = '';
if(it's january) { monthSrc = 'jan'; }

and so on, then

document.write('<script type="text/javascript" src="'+monthSrc+'.js"></script>');

Make sense?

isabel ringing
04-09-2003, 05:32 PM
Thanks brothercake.
I kinda suspected that might be a can o' worms. I will give your suggestion a try.