Question!!

This is a discussion on "Question!!" within the JavaScript Forum section. This forum, and the thread "Question!! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 2nd, 2006, 21:58
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Smile Question!!

Can anyone find where I messed up in this code?

Code: Select all
<script type="text/javascript">
<!-- Hide from non-JavaScript browsers
var Today=new Date("October 15, 2006");
var ThisDay=Today.getDate();
var ThisMonth=Today.getMonth()+1;
var ThisYear=Today.getFullYear();
var DaysLeft=XmasDays(Today);
document.write("Today is "+ThisMonth+"/"+ThisDay+"/"+ThisYear+"<br />");
document.write("Only "+DaysLeft+" days until Christmas");
// Stop hiding -->
</script>
Code: Select all
function XmasDays(CheckDay) {
var XYear=CheckDay.getFullYear();
var XDay=new Date("December, 25, 2006");
XDay.setFullYear(XYear);
var DayCount=(XDay-CheckDay)/(1000*60*60*24);
DayCount=Math.round(DayCount);
return DayCount;
}
Reply With Quote

  #2 (permalink)  
Old Dec 3rd, 2006, 00:09
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: Question!!

Nevermind...I am such a freakin retard...lol
Reply With Quote
  #3 (permalink)  
Old Dec 5th, 2006, 19:30
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Question!!

Haha, smooth.
Reply With Quote
  #4 (permalink)  
Old Dec 5th, 2006, 21:51
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: Question!!

Shutup!!

The code is right, it is just well nevermind...hehehe
Reply With Quote
  #5 (permalink)  
Old Dec 28th, 2006, 16:07
Junior Member
Join Date: Dec 2006
Location: ...
Age: 14
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Re: Question!!

lol wuite simple : why did you say the following :
var Today=new Date("October 15, 2006"); ?
Saying this: var Today=new Date(); make its work flawless (at least in Firefox 2.0.0.1), it was thinking that you wantend to know how many days till critsmas from Oct 15th!

So sad im too late

Last edited by artwich; Dec 28th, 2006 at 16:17.
Reply With Quote
  #6 (permalink)  
Old Dec 28th, 2006, 18:22
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: Question!!

hahaha....that was just for testing...the problem was I named the JavaScript file one thing...and in my HTML file I linked to it with another name...so 3 hours later I find the problem and fixed it...and it worked!! Also yeah...I fixed the date so that it changes every day....lol
Reply With Quote
Reply

Tags
javascript

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Php Question longstand PHP Forum 4 Oct 21st, 2007 01:12
another question please....... napstar Starting Out 3 Feb 20th, 2007 22:28
css question Daniel Web Page Design 29 Feb 16th, 2007 12:13


All times are GMT. The time now is 19:01.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43