Link to home
Start Free TrialLog in
Avatar of bkaneweb
bkaneweb

asked on

Class is not defined error (and "is not a constructor error" too) when trying to implement Vista-like Ajax calendar (v2)

I am trying to implement the calendar from http://dev.base86.com/scripts/vista-like_ajax_calendar_version_2.html, and I included all of the javascript files, php files, and have mootools already successfully running. When I try to create the object (?) I get an error. The code I am using is attached.

Please let me know if you see where the problem is, or where to fix it. I did not change any of the code that I downloaded from the calendar website.

Thanks.
in events.php page: echo "<script>addLoadEvent(createCalendar);</script>";
 
and in my javascript function page:
 
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
function createCalendar()
{
	new vlaDatePicker('exampleI', {offset: { y: -2, x: 2 }, format: 'm/d/y'} );
	new vlaCalendar('block-element-id', {filepath:'calendar/'});
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bkaneweb
bkaneweb

ASKER

Sorry it took so long to respond. That worked perfectly...thanks for the help!!
glad to help.