1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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