[jQuery] (no subject)
[jQuery] (no subject)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=484145808-19122006><FONT face=Verdana
color=#0000ff size=2>Try this (untested):</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484145808-19122006><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=484145808-19122006><FONT face=Verdana
color=#0000ff size=2>$(function() {</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484145808-19122006><FONT face=Verdana
color=#0000ff size=2> $('.y').html( (new Date).getFullYear()
);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484145808-19122006><FONT face=Verdana
color=#0000ff size=2>});</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484145808-19122006><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=484145808-19122006><FONT face=Verdana
color=#0000ff size=2>-Mike</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484145808-19122006><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=484145808-19122006><FONT face=Verdana
color=#0000ff size=2>p.s. Could we avoid profanity on the mailing list?
Thanks.</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> discuss-bounces@jquery.com
[mailto:discuss-bounces@jquery.com] <B>On Behalf Of </B>Kristaps
Ancans<BR><B>Sent:</B> Tuesday, December 19, 2006 12:44 AM<BR><B>To:</B>
discuss@jquery.com<BR><B>Subject:</B> [jQuery] (no
subject)<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>Ok i'm a newbie in jquery and i'm trying to write function that will
replace all <span class="y"><!-- --></span> element's
content with current year.</DIV>
<DIV> </DIV>
<DIV>My function looks like this:</DIV>
<DIV> </DIV>
<DIV>$(function(){<BR> $(".y").ready(function() {<BR> var
today = new Date();<BR> var year =
today.getFullYear();<BR> document.write(year);<BR> });</DIV>
<DIV>});<BR clear=all></DIV>
<DIV>but when i run it - it replaces all the document with current year. In
which place my mistake is ? <BR>-- <BR>FYFI - for your fucking information
</DIV></BLOCKQUOTE></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/