Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Current date and Background questions...

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I know how to insert a date for when a page has been updated, but is there a way of inserting the current date?

Also, can I select a whole load of objects and make them appear on every page in the background?

Thx
 
You want the current date to be displayed on the page maybe like this - ??? DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Yes, yes... just like that. How do you do it in FP??!! - (I'm guessing some html code's coming!?)
 
Don't know how to automate in FP. But here is the code. This goes inbetween the head tags:
Code:
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;>
<!-- Hide From Oldies
today=new Date();

// Build an array initializer
function isnArray() {
	argnr=isnArray.arguments.length
	for (var i=0;i<argnr;i++) {
		this[i+1] = isnArray.arguments[i];
	}
}

// And months and day arrays
var isnMonths=new isnArray(&quot;01&quot;,&quot;02&quot;,&quot;03&quot;,&quot;04&quot;,&quot;05&quot;,&quot;06&quot;,&quot;07&quot;,&quot;08&quot;,&quot;09&quot;,&quot;10&quot;,&quot;11&quot;,&quot;12&quot;);
var isnDays= new isnArray(&quot;Monday&quot;,&quot;Tuesday&quot;,&quot;Wednesday&quot;,&quot;Thursday&quot;,&quot;Friday&quot;,&quot;Saturday&quot;,&quot;Sunday&quot;);
isnDays[0]=&quot;Sunday&quot;;

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}
</script>	
//  -->

This goes where you want the date to show:
Code:
<script language=&quot;JavaScript&quot;>
	<!--Hide JavaScript

var thisyear = today.getYear(); // varies in JavaScript and JScript
 
document.write(isnMonths[today.getMonth()+1]+&quot; / &quot;+today.getDate()+&quot; / &quot;)

if (thisyear >= 2000) { // covers JScript post 2000
	document.write(thisyear);
	}
else { // covers JScript from 1900 thru 1999 and JavaScript until 3899
	document.write(1900 + thisyear);
	} // not handled: JScript pre 1900

// End hiding of script -->

	</script>

Good Luck! DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top