Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

What version of javascript does IE6 and IE7 use

I am trying to calculate the difference between dates in years and months.  I was delighted when I found the functions getFullYear and getFullMonth.  However when I use them I get the following error:  Object doesn't support this property or method.
My research shows that the functions were implemented in javascript 1.3.  Some sites show IE6/7 has using version 1.2 and others 1.3.  Which is it?  Or do I just I have my syntax wrong?  I am using IE7, Visual Studio 2008 and C#.
Thank you.
relevent code:
 
var BDate =  document.getElementById("txtBirthdate");
            var ODate = document.getElementById("txtOnsetDate");
            var BOD = Date(BDate.valueOf);
                 var years = BOD .getFullYear() - BOD .getFullYear();

Open in new window

0
RosalindP
Asked:
RosalindP
  • 2
1 Solution
 
xBelloxCommented:
Use "new" to create an object:

var BOD = Date(BDate.valueOf);

Open in new window

0
 
xBelloxCommented:
Opps, I said it right, but "copy and paste" it worng... The right should be:


var BOD = new Date(BDate.valueOf);

Open in new window

0
 
RosalindPAuthor Commented:
The actual statement is var BOD = new Date(BDate.value);  The new statement was the key.  Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now