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
    Jun 2002
    Location
    ON. Canada
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Clock with error??

    I like this clock ... but I keep getting an error Expect '' for the line browser = 'Netscape'else; browser = 'NN';

    As a newbie to java.. please help me

    thanks

    Freddi

    <SCRIPT>
    var browser = '';
    var version = '';
    var entrance = '';
    var cond = '';
    // BROWSER?
    if (browser == '')
    {
    if (navigator.appName.indexOf('Microsoft') != -1)
    browser = 'IE';else if (navigator.appName.indexOf('Netscape') != -1)
    browser = 'Netscape'else; browser = 'NN';
    }
    // VERSION?
    if (version == ''){
    version= navigator.appVersion;
    paren = version.indexOf('(');
    whole_version = navigator.appVersion.substring(0,paren-1);
    version = parseInt(whole_version);
    }
    // BROWSER & VERSION
    if (browser == 'IE' && version >= 4) entrance = 'yes';
    if (browser == 'IE' && version < 4) entrance = 'no';
    if (browser == 'Netscape' && version >= 2.02) entrance = 'yes';
    if (browser == 'Netscape' && version < 2.02) entrance = 'no';
    if (entrance=='yes'){
    name0a = new Image;name0a.src = 'buttons/green/nextoff.gif';
    name0b = new Image;name0b.src = 'buttons/green/nexton.gif';
    }
    function lighten(imgName) {
    if (entrance == 'yes'){
    imgOn = eval(imgName + 'b.src');
    document[imgName].src = imgOn;}
    }
    function darken(imgName) {
    if (entrance == 'yes'){
    imgOff = eval(imgName + 'a.src');
    document[imgName].src = imgOff;}
    }
    // STOP HIDE -->
    </SCRIPT>
    <SCRIPT LANGUAGE="JavaScript"><!--
    d = new Date();
    dateText = "";
    dayValue = d.getDay();
    if (dayValue == 0)
    dateText += "Sunday,";
    else if (dayValue == 1)
    dateText += "Monday,";
    else if (dayValue == 2)
    dateText += "Tuesday,";
    else if (dayValue == 3)
    dateText += "Wednesday,";
    else if (dayValue == 4)
    dateText += "Thursday,";
    else if (dayValue == 5)
    dateText += "Friday,";
    else if (dayValue == 6)
    dateText += "Saturday,";

    monthValue = d.getMonth();
    dateText += " ";
    if (monthValue == 0)
    dateText += "January";
    if (monthValue == 1)
    dateText += "February";
    if (monthValue == 2)
    dateText += "March";
    if (monthValue == 3)
    dateText += "April";
    if (monthValue == 4)
    dateText += "May";
    if (monthValue == 5)
    dateText += "June";
    if (monthValue == 6)
    dateText += "July";
    if (monthValue == 7)
    dateText += "August";
    if (monthValue == 8)
    dateText += "September";
    if (monthValue == 9)
    dateText += "October";
    if (monthValue == 10)
    dateText += "November";
    if (monthValue == 11)
    dateText += "December";

    if (d.getYear() < 2000)
    dateText += " " + d.getDate() + ", " + (1900 + d.getYear());
    else
    dateText += " " + d.getDate() + ", " + (d.getYear());

    minuteValue = d.getMinutes();
    if (minuteValue < 10)
    minuteValue = "0" + minuteValue

    hourValue = d.getHours();
    if (hourValue == 0)
    {
    greeting = "Good morning, ";
    timeText = " at " + (hourValue+12) + ":" + minuteValue + " AM";
    }
    else if (hourValue < 12)
    {
    greeting = "Good morning!";
    timeText = " at " + hourValue + ":" + minuteValue + " AM";
    }
    else if (hourValue == 12)
    {
    greeting = "Good afternoon!";
    timeText = " at " + hourValue + ":" + minuteValue + " PM";
    }
    else if (hourValue < 17)
    {
    greeting = "Good afternoon!";
    timeText = " at " + (hourValue-12) + ":" + minuteValue + " PM";
    }
    else
    {
    greeting = "Good evening!";
    timeText = " at " + (hourValue-12) + ":" + minuteValue + " PM";
    }
    document.open();
    document.write(greeting + " It's " + dateText + timeText);
    //-->
    </SCRIPT>

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Change this:

    browser = 'Netscape'else; browser = 'NN';

    To this:

    browser = 'Netscape'; else browser = 'NN';
    Quíet Storm Designs ~ Art is not what you see, but what you make others see.
    · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Location
    ON. Canada
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    Thank you Quiet thank you so much

    Freddi


  •  

    Posting Permissions

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