T3 Community Discussion & Support

Let's build the best free Joomla template framework, together!
  1. Gerhard Bies
  2. Sherlock Holmes
  3. General Discussion
  4. Tuesday, 19 November 2013
  5.  Subscribe via email
Hi,

want to use jquery to get corrent year with this code,

did insert this in the injection after <body>
and would use the jquery from T3 or joomla 3.2 and not imported from <script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>


<script type="text/javascript">
var currentYear = (new Date).getFullYear();
$(document).ready(function() {
$("#year";).text( (new Date).getFullYear() );
});
</script>

and in the Hmtl module i use this

<p>Copyright <span id="year">TEXT</span> Company Name - All Rights Reserved.</p>

but is not working

what must i change


regards

Gerhard

t3-framework and template 1.42
joomla 3.2
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
Hi Gerhard,

Please try with this script.

<script type="text/javascript">
(function($){
$(document).ready(function(){
$('#year').text( (new Date).getFullYear() );
});
})(jQuery);
</script>


Regards
Comment
There are no comments made yet.
  1. more than a month ago
  2. General Discussion
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.