Object expected -error

They have: 105 posts

Joined: Jan 2002

For some reason, I keep getting an "object expected" error in my header file script (line 46), but that line is the end of my javascript all together. Can someone take a look at the page?

cprhosting.com

Thanks in advance. I don't know much about code and the guy who designed the page won't e-mail me back (no comment on that though)

CPRhosting.com - CPR Hosting...Giving life to the web
Custom-made Hosting Plans starting at $2

They have: 601 posts

Joined: Nov 2001

Hm. Why have you got that javascript pre-load code in there anyway? Your nav bar, with the roll-overs are done in Flash. Not sure where the error is, though - it looks like code inserted by Dreamweaver. What is it's purpose?

- wil

They have: 105 posts

Joined: Jan 2002

no clue. someone else designed the basic layout of the site with the menus, but I've since had to make modifications to tailor the site.

Dreamweaver inserts? I'm not sure what you're referring to. Could you cut/paste for me?.

CPRhosting.com - CPR Hosting...Giving life to the web
Custom-made Hosting Plans starting at $2

They have: 601 posts

Joined: Nov 2001

OK. I can see you need the pop-up window code. Not for the front page, but for the next few pages. Obviously a cut & paste job was going on here - [ cut&paste is your number 1 enemy. Avoid at all costs! Smiling ].

Not sure why you need the roll-over code, though. Is the Navigation bar new? Did you used to have a set of graphics there before you inserted the Flash nav bar there instead?

- wil

detox's picture

They have: 571 posts

Joined: Feb 2001

Not wanting to sound like a know it all, but whenever I redesign a page or make any serious changes I alway start again from scratch, might take a little longer, but you know that what is there is meant to be there.

They have: 601 posts

Joined: Nov 2001

Yes. Cut & Paste is the enemy! However, templates can be extremly helpful for a large site.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

<script language="JavaScript">


<!-- Begin
function topWindow(){
popup = window.open("price_guide.html","","height=200,width=550, scrollbars=yes");
}
// End -->
&lt;/script&gt;

<strong><!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//-->
&lt;/script&gt;
</strong>
'

You are missing an opening <script> tag.

If you don't need this, which I don't think you do, just delete all the stuff I put in bold.

Smiling Suzanne

They have: 105 posts

Joined: Jan 2002

suzanne, you're the greatest!!

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.