Bob Schwartz wrote:
This one all alone on the page, with no linked JS in the <head>:
<div id="copy">
<script type="text/javascript">
...
document.write("&copy; "+yr);
</script>&nbsp;Cedar Tree Books
</div>

<p id="copy">© 2005 Cedar Tree Books</p>

No script (or entity reference) required.

I'm going to take your much appreciated response one bit at a time.

By doing as you suggested, I lose the point of having used the JS in the first place.

I realise that, but by using javascript to output content, you're not really separating the layers. You could use a server side script to generate it or simply use a serve side include file in all your pages, where you would only have to update it once.

If you really want the client side script, you could do something like this:

<p id="copy">© Cedar Tree Books</p>

var txtCopy = document.getElementById("copy").childNodes.item(0);
var year = (new Date()).getFullYear();
txtCopy.replaceData(1, 0, " " + year);

--
Lachlan Hunt
http://lachy.id.au/

******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to