Solved

What version of javascript does IE6 and IE7 use

Posted on 2009-07-15
4
309 Views
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

0
Comment
Question by:RosalindP
  • 2
4 Comments
 
LVL 9

Expert Comment

by:xBellox
Comment Utility
Use "new" to create an object:

var BOD = Date(BDate.valueOf);

Open in new window

0
 
LVL 9

Accepted Solution

by:
xBellox earned 500 total points
Comment Utility
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
 
LVL 41

Expert Comment

by:HonorGod
Comment Utility
0
 
LVL 1

Author Closing Comment

by:RosalindP
Comment Utility
The actual statement is var BOD = new Date(BDate.value);  The new statement was the key.  Thank you.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now