...

View Full Version : Help with nesting a javascript



AshleyQuick
12-31-2003, 06:30 PM
Can this javascript:

defaultStatus ="Copyright 2004 XYZ, Inc. - All Rights Reserved."

...be modified so that the yr is automatic?

I use the following script in my footer and was hoping it could be merged somehow/way with the status script above. Everything I've tried is producing errors.

<script type="text/JavaScript">
<!--
today=new Date();
y0=today.getFullYear();
//-->
</script> <script type="text/JavaScript">
<!--
document.write(y0);
//-->
</script>

Mr J
12-31-2003, 07:47 PM
This should do it

<script type="text/JavaScript">
<!--
today=new Date();
this_year=today.getFullYear();
defaultStatus ="Copyright "+this_year+" XYZ, Inc. - All Rights Reserved."
//-->
</script>

Philip M
12-31-2003, 07:52 PM
<script type="text/JavaScript">
<!--
today=new Date();
y0=today.getFullYear();
defaultStatus ="Copyright "+ y0 + " XYZ, Inc. - All Rights Reserved."
</script>


Seems to work OK.

Mr J beat me to it!

AshleyQuick
12-31-2003, 07:59 PM
They both work great, thanks!

Happy New Year!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum