Go Back   Free website templates > Web Template Help > JavaScript
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Join now to share free website templates or post on the forum. If you have never been on a forum before read the FAQ. It's quick, easy and free to join!
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-18-2008, 10:55 AM
ishkey's Avatar
Moderator
 
Join Date: Aug 2007
Location: North GA USA
Posts: 1,776
ishkey will become famous soon enough
Default Add a date to your page

Add this javascript anywhere on the page you want todays date to show. If you just want to see how it looks, copy the entire code and save it as date.html, then open it with your browser.
Code:
 
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Created on: 10/15/2008 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title></title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var now = new Date();
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;
document.write(today);
// End -->
</script>
 
</body>
</html>
__________________

Consultant - Programmer - WebMaster
cleandeck - lawn mower undercoating
wilmargraphite - graphite lubricants
Reply With Quote
  #2 (permalink)  
Old 10-18-2008, 08:04 PM
pezboy45's Avatar
Mod/Design & Coder [Pro]
 
Join Date: Nov 2006
Location: Hawaii
Posts: 685
pezboy45 is on a distinguished road
Send a message via AIM to pezboy45 Send a message via MSN to pezboy45
Default

Awesome!
I am actually going to use this....
Right now.
Thanks a bunch.
Reply With Quote
  #3 (permalink)  
Old 07-18-2009, 08:47 PM
Junior Member
 
Join Date: Jul 2009
Posts: 2
genroxbro is on a distinguished road
Default Add a date to your page

hi

the hscripts tool is based only on javascript and it would work on any web page.

You can create any no of menus on that and the code is generated through that tool. U can just copy the code and paste it on the head section of the html page

i.e
<html><head> tool generated code </head>

In your script they are using different technique , i couldnt follow up that code.

Thanks & Regards
_____________________________________
Are you looking to get
canadian payday loans ?

Last edited by CovertPea; 07-19-2009 at 02:33 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

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



All times are GMT. The time now is 09:20 AM.



mouseover mouseover mouseover