Aamirkhan
Aamirkhan

Reputation: 5784

'Object' is undefined with calendar.js

I have this line in my JS it is working fine in IE, but in Firefox it's giving an error "document is undefined" . I got this error by using firebug, see the line and help me to come out from this

x = event.layerX+document.documentElement.scrollLeft; 
y = event.layerY+document.documentElement.scrollTop;

I am trying to make the devshed tutorial for JavaScript Object lesson to work in my PC.

The calendar.js file has the object 'Calendar' constructed but when I called using the below html doc, I get the

Calendar' is undefined error for line 6 and 7, where the obj1 and obj2 are specified.

The full code of the calendar.js is in http://www.devshed.com/Client_Side/J...ect/page9.html Both the files are in the same directory. I am using Windows 2000 Professional with IE6. Appreciate any help to resolve this problem.

<html>
<head>
<script language="JavaScript" src="calendar.js"></script>
</head>
<body bgcolor="white">
<script> obj1 = new Calendar(2, 2005); </script>
<script> obj2 = new Calendar(7, 2001); </script>
</body>
</html>

Upvotes: 2

Views: 814

Answers (2)

Gaurav Gaira
Gaurav Gaira

Reputation: 41

Make sure your file src="" path is correct one. check if file is included or not ?

Upvotes: 1

Gaurav Gaira
Gaurav Gaira

Reputation: 41

are you using jquery in this ? or have you try to go with firebug to check particular DOM Object error ?

Upvotes: 0

Related Questions