scripting error

They have: 24 posts

Joined: Apr 2003

Need some help.. am using a javascript menu... on all my customers sites... on each and everyone.. there is a "scripting error" in IE... not sure about netscape... all pages load just fine.. but at bottom left of browser window.. is "done but with error".. if you click that on.. it tells you the line and charactor.. problem is... most of the time...there is nothing on that line.. or... it is a standard heading code such as and ... no any one time.. is it a line that has javascript on it.. have done some research.. and I see.. that on each page.. I need a "dda" file.. well there is one on each page.. but I still get the error. It don't really bother me that much.. cuz the pages still load.. but have new customer and it bugs her... any help would be appreciated.. the test site is voiceone.net/utilibiz thanx in advance...

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

1. validate your code -- you have a table in the head tag!

2. http://javascript.internet.com/messages/text-highlighter.html is the problem, it has the same error.

3. Error: document.a has no properties
Source File: http://www.voiceone.net/utilibiz/
Line: 85

4. You have other issues besides the JavaScript. As the JavaScript isn't very useful, you should probably just remove it. Also, the errors are endless. Try using Netscape 7 and the JavaScript Console to see the error -- and how constant it is. It will suck up a lot of resources.

5. It's not the menu.

6. &nsbp;!!

They have: 24 posts

Joined: Apr 2003

I admit .. not very useful.. the javascript. .but client wanted it.. so I did it.. but.. I get that error on other sites too.. was reading about different DDA files at w3d... and was thinking that was the problem.. that the browsers were not knowing what format to encode.. am I way out in left field on this?...

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

!? You get the error that the table is in the head element instead of in the body element? What is w3d? What is a DDA file!?

The client wanted a javascript that would highlight the text?

They have: 24 posts

Joined: Apr 2003

and just checked. .don't see a table in between my head tags. only my meta tags...can you expand please.. thanx in advance

They have: 24 posts

Joined: Apr 2003

am sorry.. site for validations..ooops.. it is wdg... that is the site

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Also, the text highlighter has the two colours set to the same colour -- it's entirely pointless.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

<!doctype html public "-//w3c//dtd html 3.2//en" "http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>
<title>
UtiliBiz Solutions
</title>
<meta name="Description" content="Arachnophilia 4.0">
<meta name="Robots" content="all">
<meta name="Keywords" content="Arachnophilia 4.0">
</head>

<style type="text/css">
body { background-color: white; color:black; font-family: arial, sans-serif; margin-top:0px; margin-bottom:0px; margin-left:0px; margin=right:0pxl}
p {line-height:20px; margin-top: 15px; margin-bottom: 0px; margin-left:25px; margin-right: 0px;}
.first {font-style:normal; font-weight: normal;}
h1 {text-align:center; font-family:arial; color:black;font-size:20px;}
h2, h3{margin-left: -10px; font-family:arial; color:blue; background-color: transparent;}
ul { list-style-type: circle; font-style: normal; font-weight: normal;}
  margin-top:0px; margin-left:50px; padding-left:0px; }
li {margin-bottom:0px; left-margin:850px; font:18;}
address { color: #cc0000; background-color: transparent; text-align: center;}
a {color: red; background-color: transparent; }
address a {font-weight: normal; color: yellow; backgournd-color: navy; padding-left: 5px padding-right: 5px;}
</style>

<table  width="101%" height="23%" border="0" cellspacing="0" cellpadding="0">

<tr>
<!-- Row 1 Column 1 -->
<td bgcolor="#dddddd" >
<img src="utilibiz2.gif" alt="">
</td>
<!-- Row 1 Column 2 -->
<td bgcolor="#6699cc" >
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

</td>
<!-- Row 1 Column 3 -->
<td bgcolor="#ffff66" >
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

</td>
<!-- Row 1 Column 4 -->
<td bgcolor="#66cccc">

&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp

</td>
<!-- Row 1 Column 5 -->
<td background="bg1.gif" width="45%" height="100%" alt="">
<!-- ONE STEP TO INSTALL TEXT HIGHLIGHTER:

1.  Copy the coding into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document  -->

<body>

&lt;script LANGUAGE="JavaScript"&gt;
<!-- Original:  K. Rama Moorthy -->
<!-- Web Site:   <a href="http://www.suyambhu.bizhosting.com" class="bb-url">http://www.suyambhu.bizhosting.com</a> -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! <a href="http://javascript.internet.com" class="bb-url">http://javascript.internet.com</a> -->

<!-- Begin
text = "welcome"; // The text to scroll
color1 = "aqua"; // original text color
color2 = "aqua"; // new character color
fontsize = "5"; // font size of text
speed = 200; // how fast to rotate to next character
// time is in milliseconds, (i.e. 1000 = 1 second)

i = 0;
if (navigator.appName == "Netscape") {
document.write("<layer id=a visibility=show></layer><br><br><br>");
}
else {
document.write("<div id=a></div>");
}
function changeCharColor()  {
if (navigator.appName == "Netscape") {
document.a.document.write("<left><font size =" + fontsize + "><font color=" + color1 + ">");
for (var j = 0; j < text.length; j++) {
if(j == i) {
document.a.document.write("<font color=" + color2 + ">" + text.charAt(i) + "</font>");
}
else {
document.a.document.write(text.charAt(j));
   }
}
document.a.document.write('</font></font></left>');
document.a.document.close();
}
if (navigator.appName == "Microsoft Internet Explorer") {
str = "<left><font size=" + fontsize + "><font color=" + color1 + ">";
for (var j = 0; j < text.length; j++) {
if( j == i) {
str += "<font color=" + color2 + ">" + text.charAt(i) + "</font>";
}
else {
str += text.charAt(j);
   }
}
str += "</font></font></left>";
a.innerHTML = str;
}
(i == text.length) ? i=0 : i++; // reset after going through all letters
}
setInterval("changeCharColor()", speed);
//  End -->
&lt;/script&gt;


<!-- Script Size:  1.89 KB -->


</td>
</tr>
</table>
<table  width="101%" bgcolor="#990033" border="0" cellspacing="1" cellpadding="0">
<tr>
<td  align="center">
</td>
</tr>
</table>

&lt;script&gt;

&lt;script type='text/javascript'&gt;

//HV Menu- by Ger Versluis (<a href="http://www.burmees.nl/" class="bb-url">http://www.burmees.nl/</a>)
//Submitted to Dynamic Drive (<a href="http://www.dynamicdrive.com" class="bb-url">http://www.dynamicdrive.com</a>)
//Visit <a href="http://www.dynamicdrive.com" class="bb-url">http://www.dynamicdrive.com</a> for this script and more

function Go(){return}

&lt;/script&gt;
&lt;script type='text/javascript' src='exmplmenu_var.js'&gt;
&lt;/script&gt;
&lt;script type='text/javascript' src='menu_com.js'&gt;
Your browser seems to have java turned off.

&lt;/script&gt;
<table  width="101%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- Row 1 Column 1 -->
<td  width="34%" height="100%" background="bg.gif" align="left">
<div style="position: absolute; top:175px; left:65px; width:475px; height:30px">
&lt;script&gt;

/*Current date script credit:
JavaScript Kit (<a href="http://www.javascriptkit.com" class="bb-url">javascriptkit.com</a>)
Over 200+ free scripts here!
*/

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("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write("<small><font color='aqua' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</b></font></small>")

&lt;/script&gt;

</div>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<center>
<font color="black">
Best If Viewed In
</center>
</font>
<center>
<a href="http://www.microsoft.com/downloads/search.asp?"><img src="ie.gif" alt=""></a>
<br>
at 1024x768
</center>
<br>
<br>

<center>
<font color="black" size="1">
Web Site Developed and Hosted by
<a href="http://www.voiceone.net" target="new window" ONCLICK="window.open('http:<a href="http://www.voiceone.net" class="bb-url">voiceone.net</a>','new window',);return false"><br>Voiceone Web Design.</a>
</font>
</center>

</td>
<td  width="1%" bgcolor="#0033cc" align="left">
</td>





<!-- Row 1 Column 2 -->
<td width="64%" align="left">

<font size="3" color="#000000" face="arial">
<br>
<br>

<h1>
&nbspOur Mission
<br>
</h1>
<p>

To be the preferred provider of short- and medium-&nbspterm accounting and
finance-related support to utilities  throughout  the United States.

<br>
<br>
<br>

&nbsp&nbspWe will accomplish our mission by proudly serving each utility and by
providing:
</p>
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp1. Cost-effective solutions
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp2. Personalized attention to each client
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp3. 100% customer satisfaction
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp4. Highly qualified and competent employees
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp5. Open and honest communication

<br>
&nbsp&nbsp&nbsp&nbsp&nbsp6. High morals and work ethics
<br>
<br>
<br>
<p>
&nbsp&nbspWe add value to our clients' utility business in the following areas:
</p>
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp1. Temporary staffing
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp2. Controllership functions
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp3. Accounting
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp4. Training and  education

<br>
&nbsp&nbsp&nbsp&nbsp&nbsp5. Tax
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp6. Internal and external reporting
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp7. Human resources
<br>
&nbsp&nbsp&nbsp&nbsp&nbsp8. Communication in the workplace
<br>
<br>
<br>




<center>
For more information, please e-mail us at:

<br>
<br>

<a href="mailto:[email protected]"> <a href="mailto:[email protected]" class="bb-email">[email protected]</a> <mailto:[email protected]>.</a>
</center>


</font>
</td>
</tr>
</table>








</body>

</html>
'

They have: 24 posts

Joined: Apr 2003

must admit was a quick fix easy fix to have different color text on that background.. but was getting the error before that script too

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You're right -- it's not in the head element. It's between the head element and the body element. It should NOT be there.

The style element should be in the head tags. The only JavaScript errors I'm getting are related to the text highlighter script.

They have: 24 posts

Joined: Apr 2003

aha.. ok. thanx. .will try that...

They have: 24 posts

Joined: Apr 2003

ok. moved it down.. (not uploaded yet).. but still get line 219 error... but if I refresh the page.. it goes away... that has been the norm on other sites I create too...

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You have so many errors still -- you really should improve your basic coding skills.

Anyway: http://www.zerocattle.com/examples/voiceone/

Does this file have the errors?

They have: 24 posts

Joined: Apr 2003

yes it does.. I have IE 6.0 with all the fixes too.. got the error message line 130 char 50

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

*sigh* okay -- what's the error? Can you print it? I'm still getting all the line 85 errors because they are so bad.

They have: 24 posts

Joined: Apr 2003

only says line 130
char 50
error syntax error
code 0

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Okey dokey, and you're getting that for my file as well as yours?

Error: syntax error
Source File: http://www.voiceone.net/utilibiz/
Line: 133
Source Code:
<script type='text/javascript'> is the other error I'm getting -- you have <script> and it's just a remnant -- that's why you need to validate and fix your HTML code.

It's probably the same problem.

They have: 24 posts

Joined: Apr 2003

ok. thanx.. I am using arachnophilia as editor... will see what I can do with that.. thanx for all the help.. I really do appreciate it

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Arachnophilia isn't the problem -- you have to fix the html. Try using http://validator.w3.org for help in finding the bigger problems like open tags. They WILL cause problems, as will having &nbsp instead of &nbsp; which you have all over the page.

You may want to seriously consider using more semantic HTML instead of spaces in the code. It will go together much smoother.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.