dusher
Junior Member
Posts: 6
Registered: 3/20/2007
Member Is Offline
|
| posted on 3/20/2007 at 07:03 AM |
|
|
JS error: calendar2 not defined
I am getting a JS error calendar2 not defined.
Tigra cal is being called from a perl script that generates all html including frameset. The perl is located in /cgi-bin/calendar/. So I placed
calendar2.js and calendar.html there and chmod'ed everything wide open for testing.
I have the following html code in view source (abbeviated for clarity):
<HTML><HEAD>
<TITLE>Calendar DEV (T0) </TITLE>
<!-- Calendar Date Picker mm/dd/yyyy -->
<script language="JavaScript" src="calendar2.js"></script>
</HEAD>
<BODY ... >
<TABLE BORDER=0 ><CENTER>
<FORM METHOD="POST" enctype="multipart/form-data" action = "/cgi-bin/calendar/alpha.pl" NAME="Alpha" TARGET="Bodyframe">
... a few non-java form elements for variables ....
<input type="Text" name="ScheduledWork_Date" value="">
<a href="javascript:cal1.popup();"><img src="/acme/images/cal.gif" width="16" height="16" border="0" alt="Pick
Date"></a>
... a few more non-java form elements for variables ....
<input type="image" src="/alpha/images/bt-Continue.gif" width="180" border="0" TABINDEX = "3" >
</form>
.. nothing between end of form and object creation ....
<script language="JavaScript">
<!-- // create calendar object
var cal1 = new calendar2(document.forms['Alpha'].elements['ScheduledWork_Date']);
cal1.year_scroll = false;
cal1.time_comp = false;
</script>
</BODY></HTML>
Any help would be greatly appreciated. Thank You!
|
|
|
tigra
Administrator
Posts: 1920
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 3/20/2007 at 02:26 PM |
|
|
the code looks good. probably calendar2.js is missing or at different location.
|
|
|
dusher
Junior Member
Posts: 6
Registered: 3/20/2007
Member Is Offline
|
| posted on 3/20/2007 at 05:27 PM |
|
|
Thanks for your help. I found out that apache does not allow js to execute in cgi-bin. I'll have to move it to htdocs and repoint.
I'm assuming calendar.html has to be in the same dir with the js, correct?
|
|
|
dusher
Junior Member
Posts: 6
Registered: 3/20/2007
Member Is Offline
|
| posted on 3/20/2007 at 07:24 PM |
|
|
I moved the .js and calendar.html to /htdocs/datepicker
File perms are wide open for testing.
In the header, I have
<!-- Calendar Date Picker mm/dd/yyyy -->
<script language="JavaScript" src="/datepicker/calendar2.js"></script>
My page loads without JS error, but when I click on the calendar icon, I get the popup, but it has a server error
The apache log shows: server error: Premature end of script headers: calendar.html, referer: http://roadrunner1.els-an.att.net/cgi-bin/calendar/alpha.pl
It looks like calendar.js cant find calendar.html. Any ideas? Do I need to put a path in the js?
|
|
|