JavaScript - Extremely New To This- Can Anyone Help????
Hi- I'm taking a programming course and am in over my head. The course is external and I am struggling!
I don't think I am searching or collecting the right information with my code. I am asking a user for their date of birth and then outputting some information for them. I need to calculate their month of birth as a number, create a date object for their dob, create a date object for the current time, the users age in milliseconds, age in days. This is what I have, can anyone help???? <html> <head> <script> //Constants to be used Months ='janfebmaraprmayjunjulaugsepoctnovdec'; PI = 3.14159265358979323846; Milliseconds_per_day = 1000*60*60*24; Milliseconds_per_year = (Milliseconds_per_day*365.2424); Length_of_Intellectual_Cycle = 33; Length_of_Emotional_Cycle = 28; Length_of_Physical_Cycle = 23; //Variables to be used var yearOfBirth = prompt('Enter your year of birth','19XX'); var monthOfBirth = prompt('Enter your month of birth','January'); var dateOfBirth = prompt('Enter your day of birth','1-31'); var inputDayofBirth; var currentTime= new Date; var inputAgeMilliseconds; var inputAgeYears; var inputAgeMonths; var inputDateOfBirth; // Calculate users Month of Birth monthOfBirth = (monthOfBirth.slice(0,3)); monthOfBirth = (monthOfBirth.toLowerCase()); monthOfBirth = (Months.indexOf(monthOfBirth)); monthOfBirth = (monthOfBirth/3); //Date object inputDateOfBirth = new Date(+yearOfBirth,+monthOfBirth,+dateOfBirth,0,0,0); DOB = new Date(+yearOfBirth,+monthOfBirth,+dateOfBirth,0,0,0); //Age Calculations inputAgeMilliseconds = (currentTime.getTime()-'DOB'); inputAgeYears = (inputAgeMilliseconds/Milliseconds_per_year); inputAgeDays = (inputAgeMilliseconds/Milliseconds_per_day); Similar TutorialsUsing PHP and javascript, I make a slideshow (which works how I want it) http://henrybuiltfurniture.com/henry...ow.php?group=1 Using AJAX, I try to put that into a div on another page (click wave bench): http://henrybuiltfurniture.com/henry...ture/index.php Now my slideshow is broken. What is the problem? I really need help fast. Thanks. |