![]() | | ||||||||
| | #1 |
| Hot Dogg Struttin Floozy Join Date: Jan 2009 Location: Oregon
Posts: 236
Thanks: 44
Thanked 17 Times in 16 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 |
| Plundering the Web War Room Member Join Date: Feb 2007 Location: , , .
Posts: 4,404
Thanks: 666
Thanked 999 Times in 773 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 |
|
Missed the last one? Don't be late on next freebie backlink space.
| |
| | |
![]() |
|
| Tags |
| java, quick |
| Thread Tools | |
| |
![]() |