Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
This script not Viewable In Netscape 7.0
Old 01-07-2004, 06:48 PM This script not Viewable In Netscape 7.0
KRYPTOR's Avatar
Skilled Talker

Posts: 62
Name: Ray
Location: Illinois
Trades: 0
Heres a problem...This script is viewable in both AOL and IE browser,
but NOT Netscape 7.0. I NEED to make it viewable in Netscape Browser.
I've taken this script to a validator website...http://validator.w3.org/check

I had 6 errors why it's not valid html
4.0 Transitional.

1. <script language="Javascript1.2">
ERROR: required attribute "TYPE" not specified

2. var tags_after_clock = "</font>"
ERROR: end tag for element "FONT" which is not open

3. document.write('<layer id="clock"></layer><br>');
ERROR: end tag for element "LAYER" which is not open

4. document.write('<span id="clock"></span>');
ERROR: end tag for element "SPAN" which is not open

5. apm="<font size='-1'>pm</font>";
ERROR: end tag for element "FONT"
which is not open

6. apm="<font size='-1'>am</font>";
ERROR: end tag for element "FONT"
which is not open

The SCRIPT IS BELOW

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<BODY>
<SCRIPT language="Javascript1.2">

var tags_before_clock = "<font face='geneva, arial, helvetica, sans-seif' size='4' color='#134c39'><CENTER><B>It is now "
var tags_middle_clock = "on"
var tags_after_clock = "</font>"

if(navigator.appName == "Netscape") {
document.write('<layer id="clock"></layer><br>');
}

if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<span id="clock"></span>');
}

DaysofWeek = new Array()
DaysofWeek[0]="Sunday"
DaysofWeek[1]="Monday"
DaysofWeek[2]="Tuesday"
DaysofWeek[3]="Wednesday"
DaysofWeek[4]="Thursday"
DaysofWeek[5]="Friday"
DaysofWeek[6]="Saturday"

Months = new Array()
Months[0]="January"
Months[1]="February"
Months[2]="March"
Months[3]="April"
Months[4]="May"
Months[5]="June"
Months[6]="July"
Months[7]="August"
Months[8]="September"
Months[9]="October"
Months[10]="November"
Months[11]="December"

function upclock(){
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes();
var sec = dte.getSeconds();
var day = DaysofWeek[dte.getDay()]
var date = dte.getDate()
var month = Months[dte.getMonth()]
var year = dte.getFullYear()

var col = ":";
var spc = " ";
var com = ",";
var apm;

if (date == 1 || date == 21 || date == 31)
{ender = "st"}
else
if (date == 2 || date == 22)
{ender = "nd"}
else
if (date == 3 || date == 23)
{ender = "rd"}

else
{ender = "th"}

if (12 < hrs) {
apm="<font size='-1'>pm</font>";
hrs-=12;
}

else {
apm="<font size='-1'>am</font>";
}

if (hrs == 0) hrs=12;
if (hrs<=9) hrs="0"+hrs;
if (min<=9) min="0"+min;
if (sec<=9) sec="0"+sec;

if(navigator.appName == "Netscape") {
document.clock.document.write(tags_before_clock+hr s+col+min+col+sec+apm+spc+tags_middle_clock+spc+da y+com+spc+month+spc+date+ender+com+spc+year+tags_a fter_clock);
document.clock.document.close();
}

if (navigator.appVersion.indexOf("MSIE") != -1){
clock.innerHTML = tags_before_clock+hrs+col+min+col+sec+apm+spc+tags _middle_clock+spc+day+com+spc+month+spc+date+ender +com+spc+year+tags_after_clock;
}
}

setInterval("upclock()",1000);
</script>
</body>
</html>

This one may be a tough one to solve...GOOD LUCK!

The KRYPTOR
__________________
"What is SEEN is TEMPORAL, What is UNSEEN is ETERNAL".


Please login or register to view this content. Registration is FREE
KRYPTOR is offline
Reply With Quote
View Public Profile Visit KRYPTOR's homepage!
 
 
Register now for full access!
Reply     « Reply to This script not Viewable In Netscape 7.0
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.34076 seconds with 12 queries