Perpetually updated birthdate for bio page

Discussion in 'JavaScript' started by solid7, Oct 20, 2013.

  1. solid7

    solid7 Well-Known Member

    Messages:
    459
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    148
    #21
    Ok, still having a bit of trouble, even though I think I worked through the first issue.

    This is my page code:

    
    (<span id="age">xx</span> years old)
    
    <script src="/udateAge.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    getAge();
    //--></script>
    
    Code (markup):
    This is my external .js file:

    
    function getAge(d,m,y) {
      var  now = new Date(),
             nowMonth = now.getMonth() + 1,
             age = now.getFullYear() - y;
       if (age < 0) return false;
      if (
      (nowMonth > m) ||
      ((nowMonth == m) && (now.getDate() >= d))
      ) age++;
         return age;
    }
    
    Code (markup):
    Still no result. Maybe a type, maybe just needs another set of eyes... I dunno. Frustrated. LOL
     
    solid7, Oct 24, 2013 IP
  2. solid7

    solid7 Well-Known Member

    Messages:
    459
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    148
    #22
    OK... Nevermind. Got it to work!!!

    Thank you to all who took the time. Really appreciate your help.
     
    solid7, Oct 24, 2013 IP