NamePros.Com (http://www.namepros.com/)
-   Programming (http://www.namepros.com/programming/)
-   -   Javascript time and date help (http://www.namepros.com/programming/452467-javascript-time-and-date-help.html)

1901gt 04-02-2008 12:01 AM

Javascript time and date help
 
Anyone know any javascript code that can showcase date and time but without the use of body onload function?

Format must be similar to this but the time must be running.

1901gt 04-02-2008 08:09 PM

anyone?

weblord 04-02-2008 08:15 PM

http://www.yaldex.com/FSDateAndTime/DateTime1.htm

Originally Posted by adiboy
Anyone know any javascript code that can showcase date and time but without the use of body onload function?

Format must be similar to this but the time must be running.


maximum 04-02-2008 09:37 PM

Originally Posted by adiboy
but the time must be running.

http://www.dynamicdrive.com/dynamicindex6/clock2.htm

weblord 04-02-2008 09:43 PM

http://www.dynamicdrive.com/dynamicindex6/clock3.htm

Originally Posted by adiboy
Anyone know any javascript code that can showcase date and time


Daniel 04-03-2008 06:05 AM

That one uses onload, is it really that important whether onload is used or not?

Dan

Irieman 04-04-2008 04:20 AM

Originally Posted by Daniel
That one uses onload, is it really that important whether onload is used or not?

No, onload only executes the function to display the clock when the page loads, but you could call the function elsewhere in the page.

Try the script weblord posted :

Originally Posted by weblord


DynamicDrive tells you to use the following code to make it work:
Code:
<body onLoad="goforit()">

It also works if you add the following code to your page, but is only displayed after the function is executed, so try to place this near the top of your html, but after the body tag:
Code:
<script>goforit();</script>
Hope this helps,
Richard

weblord 04-04-2008 04:26 AM

Thanks for modifying the script.

Originally Posted by Irieman
No, onload only executes the function to display the clock when the page loads, but you could call the function elsewhere in the page.

Try the script weblord posted :


DynamicDrive tells you to use the following code to make it work:
Code:
<body onLoad="goforit()">

It also works if you add the following code to your page, but is only displayed after the function is executed, so try to place this near the top of your html, but after the body tag:
Code:
<script>goforit();</script>
Hope this helps,
Richard


Irieman 04-04-2008 06:36 AM

No problem. :)


All times are GMT -7. The time now is 07:45 PM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0