I'm having trouble with javascript functions using an external .js file. I've implemented one of Matt Kruse's Javascript PopUp Calendar's, but can't seem to get it working on the server. It works fine on my local machine in both IE and Firefox, but when I upload it to the server I get two errors when the page loads; "getCalendarStyles is not defined" and "CalendarPopup is not defined". The html page is generated from a perl script in the cgi-bin folder and that is where the CalendarPopup.js file is located. I've tried changing permissions on the file and adding a full absolute path to the file, with no success. The code I am using in the <head> is shown below. It seems like the .js file is not being loaded, but I'm not sure how to force it to load. Is there something that needs to be configured on the server for this to work? I see that .js files are listed in the default MIME types, which I assumed was all that was needed.
Thanks,
Mike Johnson
<SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">document.write(get CalendarStyles());</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" ID="jscal10">
var cal10 = new CalendarPopup("caldiv");
cal10.setReturnFunction("setMultipleValu es2");
function setMultipleValues2(y,m,d) {
var date = new Date(y,m,d);
var wday = date.getDay();
var days = new Array("Sunday","Monday","Tuesday","Wedne sday","Thursday","Friday","Saturday")
var months=new Array("January","February","March","Apri l","May","June","July","August","Septemb er","October","November","December");
document.forms[0].date10_year.value=y;
document.forms[0].date10_month.value=(months[m-1]);
document.forms[0].date10_date.value=LZ(d);
document.forms[0].date10_wday.value=(days[wday]);
}
</SCRIPT>


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks