Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: JS error: calendar2 not defined
dusher
Junior Member

Posts: 6
Registered: 3/20/2007
Member Is Offline
posted on 3/20/2007 at 07:03 AM Reply With Quote
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!
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 3/20/2007 at 02:26 PM Reply With Quote

the code looks good. probably calendar2.js is missing or at different location.
View User's Profile View All Posts By User U2U Member
dusher
Junior Member

Posts: 6
Registered: 3/20/2007
Member Is Offline
posted on 3/20/2007 at 05:27 PM Reply With Quote

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?
View User's Profile View All Posts By User U2U Member
dusher
Junior Member

Posts: 6
Registered: 3/20/2007
Member Is Offline
posted on 3/20/2007 at 07:24 PM Reply With Quote

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?
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Calendar
Product Demonstrations Live Demos
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum
 
Tigra Calendar PRO
Product Demonstrations Live Demos
Popup Calendar
Onpage Calendar
Modal Calendar
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004