PDA

View Full Version : using javascript in a shtml page - help?!?


geekygal
11-17-2002, 06:36 PM
I created a normal html (.htm) page that used javascript to create rollover buttons in the navigation.

I then included this in the page to call up a cgi script form that I wanted to use on the web page:

<!--#include virtual="/cgi-script/csRecommend/csRecommend.cgi?command=showrecommend2" -->


This required me to change the page to a .shtml page in order for this form to run SSI.

Problem: now my javacript rollovers don't work.

What can I do? I'm at a lost and I have a deadline approaching... thanks for your help!

You can view my page at:
http://www.shiftnow.com/calendar.shtml

MCookie
11-17-2002, 07:16 PM
Hi,
Since there are three or four comments in the script in the head of your page you can't put the entire script on one line.

There is a difference between this:

<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=


and this:
<script language="JavaScript"><!--function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr;

geekygal
11-17-2002, 08:00 PM
Thanks.

Your advice worked. My rollovers work now. :) thanks for your input!

I'm not sure what happened. My original .htm docutment had the functions on different lines. Once I saved it as a .shtml file and tested it on the server, all of the code went from clean and neat on separate lines to what you saw - a mess.... Any idea as to why this happens?