Bug in Safari 4.0.3 (Released today)

Discussion in 'macOS' started by crisss1205, Aug 11, 2009.

  1. crisss1205 macrumors 6502a

    crisss1205

    Joined:
    Oct 7, 2008
    Location:
    NYC
    #1
    Ok, I just recently upgraded to Safari 4.0.3 today and I cannot get the "last modified date" script working on my site. It worked fine in Safari 4.0.2 and Firefox but not Safari 4.0.3! I am using the "document.lastModified" method. Any ideas?
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Can you elaborate on what kind of script as well as how you're using it?
     
  3. crisss1205 thread starter macrumors 6502a

    crisss1205

    Joined:
    Oct 7, 2008
    Location:
    NYC
    #3
    This is the script I was using to show site visitors when the page was last updated.
    Code:
    <SCRIPT LANGUAGE="JavaScript">
    
    
    var GM=new Date();
    
    var month=new Array(12);
    month[0]="January";
    month[1]="February";
    month[2]="March";
    month[3]="April";
    month[4]="May";
    month[5]="June";
    month[6]="July";
    month[7]="August";
    month[8]="September";
    month[9]="October";
    month[10]="November";
    month[11]="December";
    
    
    function initArray() 
    {
      this.length = initArray.arguments.length
      for (var i = 0; i < this.length; i++)
      this[i+1] = initArray.arguments[i]
    }
    
    var DOWArray = new initArray("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    var MOYArray = new initArray("January","February","March","April","May","June","July","August","September","October","November","December");
    var LastModDate = new Date(document.lastModified);
    
    document.write("Last updated on ");
    document.write(DOWArray[(LastModDate.getDay()+1)],", ");
    document.write(MOYArray[(LastModDate.getMonth()+1)]," ");
    document.write(LastModDate.getDate(),", ",(LastModDate.getYear()+1900));
    document.write(".");
    
    
    </SCRIPT>
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    I'm still running 4.0.2 and document.lastModified is undefined there too.

    It might be a WebKit issue. Here is a Chrome bug report on the same issue.
     

Share This Page