![]() |
| ||||||||
|
|||||||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
HyperActive Warrior
Join Date: Jan 2009
Location: Oregon
Posts: 161
Thanks: 34
Thanked 8 Times in 7 Posts
|
Hey Guys,
I'm looking for the javascript code that will update the date on a landing page. The closest I could find was Code:
<div style="color:Black;">
<script type="text/javascript">
var d=new Date()
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
document.write(weekday[d.getDay()] + " ")
document.write(d.getDate() + ". ")
document.write(monthname[d.getMonth()] + " ")
document.write(d.getFullYear())
</script>
</div>
|
|
|
|
|
|
|
|
|
#2 |
|
HyperActive Warrior
Join Date: Feb 2007
Location: , , .
Posts: 290
Thanks: 14
Thanked 18 Times in 17 Posts
|
You can just use old-fashioned html before and after the
javascript. Yes, you can use the document.write to add it if you wish. Here is an example of a big, bold, arial, red date using good old fashioned html and skip the <div>: <big><b><font size="6" color="red" face="arial"> <script type="text/javascript"> var d=new Date() var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thu rsday","Friday","Saturday") var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","A ug","Sep","Oct","Nov","Dec") document.write(weekday[d.getDay()] + " ") document.write(d.getDate() + ". ") document.write(monthname[d.getMonth()] + " ") document.write(d.getFullYear()) </script> </font> </b></big> You might have been under the impression that the javascript ignores previous defined fonts. A clue would have been to look at the <div> style just before. Just change the font size, color, font to whatever. Keep in mind fancy fonts may not be recognized. You could also change it using the div tag. My opinion is to leave it default black/font as is. Paul |
|
|
|
|
|
|
| The Following User Says Thank You to paulgl For This Useful Post: |
![]() |
|
| Tags |
| java, quick |
| Thread Tools | |
|
|
![]() |