DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: Date script

  1. #1
    Join Date
    Sep 2002
    Posts
    1

    Angry Date script

    Ok, I'm trying to get a script to take todays date and make a link. I can get the java to say the date on my page but I can't get it to become a link. Can anybody help? This is what I have so far

    <script language="JavaScript">
    <!-- Hide From Old Browsers


    var today_date= new Date()
    var myyear=today_date.getYear()
    var mymonth=today_date.getMonth()+1
    var mytoday=today_date.getDate()
    var today=mymonth+"."+mytoday+"."+myyear

    document.write(today)



    </script>

    I want it to open month.day.year.html i just dunno how to do it. Please help me out if you can, thanks.

  2. #2
    Join Date
    Sep 2002
    Posts
    13
    <script language="JavaScript">
    <!-- Hide From Old Browsers


    var today_date= new Date()
    var myyear=today_date.getYear()
    var mymonth=today_date.getMonth()+1
    var mytoday=today_date.getDate()
    var today=mymonth+"."+mytoday+"."+myyear


    document.write("<a href=\"http://home.pacific.net.au/~cavenagh\">"+today+"</a>")



    </script>

    just change the link from my page to where ever you want it to go.

    Sam
    http://home.pacific.net.au/~cavenagh

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links