Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how can I define a document

    Hi, help me please, i need to put this javascript (It shows the date, but it is in portuguese, but that's not the problem) in my .png file:

    var mydate=new Date()
    var year=mydate.getYear()
    if (year < 1000)
    year+=1900
    var day=mydate.getDay()
    var month=mydate.getMonth()
    var daym=mydate.getDate()
    if (daym<10)
    daym="0"+daym
    var dayarray=new Array("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado")
    var montharray=new
    Array("Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","No vembro","Dezembro")
    document.write("<small><font color='000000' face='Arial' size='2'><b>"+dayarray[day]+", "+daym+" de "+montharray[month]+" , "+year+"</b></font></small>"),

    but at the last line (document.write....) , the program says that the document is not defined.

    I'm just a beginner i don't know how to define it.

    Can someone tell me how will the code look like?

    Help me please

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Remove the comma from the end of this line


    document.write("<small><font color='000000' face='Arial' size='2'><b>"+dayarray[day]+", "+daym+" de "+montharray[month]+" , "+year+"</b></font></small>"),


    It should be ok then

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •