Friday, April 15, 2005

Trials and Tribulations ...

... with SSI development (related to my previous post on cross-browser development).

Same project, different problem. I've pretty much completed development of the survey itself, but found myself with another problem in return. The form is included on a page by way of a #exec SSI command. This for a couple of reasons:
  1. I need to be able to limit the pages on which the suvey loads;
  2. I need to be able to prevent someone who has taken the survey from taking it again
Naturally I needed to use a little scripting to accomplish the above goals. Since I have SSI enabled on the site I figured an SSI #exec would be the easiest way of accomplishing my goal. The other way would be to use a combination of an externally referenced javascript and server-side scripting (namely ASP) to dynamically set up the form display. Well, it's nice not to use client-side scripting when not necessary so I went with the SSI.

The setup is like this: Pages on the site #include the left-side menu where the survey is placed. This menu does a #exec with a script that writes out the survey (gotta love nested SSI). The problem is with pages that are ASP-based. Since ASP does not support #exec the survey script is not run and therefor the survey not loaded. The main problem with this situation is that the supporting structure does not load, which then breaks the script that controls the left-side menu, causing the to not display correctly.

<rant> The AAAS template uses a horrible structural setup and complicated javascript, making fixing problems like this a real pain. Some day I'll get around to developing a better template using CSS and the DOM. </rant>

Anyway, one way around the problem is to place the supporting structural markup around the #exec. The survey still won't load correctly on ASP pages, but at least the menu isn't broken. I think it may be the best (and maybe only) option at this point. I don't forsee needing to have the survey appear on any ASP pages, but you never know so I'd like to find a way to get it working if I can. Additionally, there are all kinds of CSS quirks I have to deal with on top of the other problems.