What version of javascript does IE6 and IE7 use

Posted on 2009-07-15
Last Modified: 2013-12-08
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

Question by:RosalindP
  • 2

Expert Comment

ID: 24862378
Use "new" to create an object:

var BOD = Date(BDate.valueOf);

Open in new window


Accepted Solution

xBellox earned 500 total points
ID: 24862391
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

LVL 41

Expert Comment

ID: 24863124

Author Closing Comment

ID: 31618567
The actual statement is var BOD = new Date(BDate.value);  The new statement was the key.  Thank you.

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't enable Flash on Chrome 32 Windows 7 any more 2 25
how can i get the sole odd and th sole even 2 33
Alert after MVC form submitted 1 22
Mozilla Favorites 10 21
Several part series to implement Internet Explorer 11 Enterprise Mode
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question