...

View Full Version : Javascript works on Firefox but blank page on Interner Explorer??



bridgey
10-03-2008, 11:25 AM
Hi - i'm trying to code a call timer for inclusion in our customer support system.

The code works in Firefox with no problems but when I view the page with Internet Explorer (the target browser that our customer support system runs on) I just see a blank page. It does load the page as if you view the source, it's there, but the page is completely blank.

Does anyone have any ideas as to why internet explorer doesn't like this page? Dreamweaver reports no HTML validation errors.

The link is: www.bridgey.net/century/timer.html - try viewing in firefox then in internet explorer.

Here's the source code:-


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" type="text/javascript">

<!--
var sec = 0;
var min = 0;
var hour = 0;
function stopwatch(text) {
sec++;
if (sec == 60) {
sec = 0;
min = min + 1; }
else {
min = min; }
if (min == 60) {
min = 0;
hour += 1; }

if (sec<=9) { sec = "0" + sec; }
document.clock.stwa.value = ((hour<=9) ? "0"+hour : hour) + " : " + ((min<=9) ? "0" + min : min) + " : " + sec;

if (text == "Start") { document.clock.theButton.value = "Pause "; }
if (text == "Pause ") { document.clock.theButton.value = "Start"; }

if (document.clock.theButton.value == "Start") {
window.clearTimeout(SD);
return true; }
SD=window.setTimeout("stopwatch();", 1000);
}

function resetIt() {
sec = -1;
min = 0;
hour = 0;
if (document.clock.theButton.value == "Pause ") {
document.clock.theButton.value = "Start"; }
window.clearTimeout(SD);
}

function offStart() {
document.clock.theButton.disabled = true;
document.clock.theButton.value = 'Started..';
document.clock.submit.disabled = false;
}

function offEnd() {
document.clock.submit.disabled = true;
}

</script>

<style type="text/css">
<!--
.style3 {font-size: 16px}
.style5 {font-size: 9px}
-->
</style>
<title>Call Timer</title>
</head>
<body onload="offEnd()">
<table width="200" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#AAD5FF" style="border-style:solid; border-width:1px; border-color:#003366">
<tr>
<td align="center"><form name="clock" action="timer_go.php" method="post" enctype="multipart/form-data" id="clock">
<font color="#003366" face="verdana, arial, helvetica, sans-serif"><b><span class="style3"><br>
<em>
<input name="ref" type="text" id="ref" style="border:1px solid #82C0FF; border-top-width:0px; border-left-width:0px; border-right-width:0px; text-align:center; background-color:#AAD5FF; font:Tahoma; font-size:14px; color:#003366" value="#12-3456" size="16" />
<br>
<br>
</em></span></b><b><em>
<input name="company" type="text" id="company" style="text-align:center; border:1px solid #82C0FF; border-top-width:0px; border-left-width:0px; border-right-width:0px; background-color:#AAD5FF; font:Tahoma; font-style:italic; font-size:10px; color:#003366" value="ABC123 Ltd" size="45" />
</em></b></font>

<p>
<input type="text" size="13" name="stwa" value="00 : 00 : 00" style="text-align:center; border:1px solid #82C0FF; background-color:#B9DCFF; font:Tahoma; font-size:16px; color:#003366" />
<br>
<br />
<input type="button" name="theButton" onClick="stopwatch(this.value); offStart()" value="&nbsp;&nbsp;Start&nbsp;&nbsp;" style="border:1px solid #82C0FF; background-color:#91C8FF; font:Tahoma; font-weight:bold; color:#003366" />
<!-- <input type="button" value="Reset" onClick="resetIt();reset();" /> -->&nbsp;
<input type="submit" name="submit" id="submit" value="&nbsp;End Call&nbsp;" style="border:1px solid #82C0FF; background-color:#91C8FF; font:Tahoma; font-weight:bold; color:#003366" />
<br>
&nbsp;</p>
</form></td>
</tr>
</table>
</body>
</html>

Thanks for your time! I look forward to your response - I'm baffled :confused:

mattyod
10-03-2008, 12:08 PM
You've commented out all the HTML :)

Firefox is just being forgiving.

Close your commenting of the JS at the bottom of your script tags



...
...
function offEnd() {
document.clock.submit.disabled = true;
}
//-->
</script>

bridgey
10-03-2008, 02:35 PM
Haha that simple eh?

Thanks a lot! :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum