Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2003
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    can I combine javascript with SSI

    Hi
    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?
    Thanks
    Last edited by isabel ringing; 04-07-2003 at 09:06 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:

    jan.js
    feb.js

    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?
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #3
    New to the CF scene
    Join Date
    Feb 2003
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks brothercake.
    I kinda suspected that might be a can o' worms. I will give your suggestion a try.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •