Forum Moderators: open
This appears right after </head>:
<body link="#000000" vlink="#808080">
<script type =" text/javascript"
src =" cart.js">
</script>
<script type =" text/javascript"
src =" set.js">
</script>
The line just before this is the one that returns the Error: Object Expected:
<form action="javascript: void 0;"
method="post"
onsubmit="SetDesc ('test1');
SetWt (1.5);
SetCode ('MB001');
SetImg ('http://*myproductURL*');
SetQA (1, 4.44, 3, 3.88, 6, 3.66);
if (ReadForm (this, true))
CallView ();
ClearAll ();
return false;">
<font style="font-size: 9pt"><b>*product-increment:price-p1*<br>*product-increment:price-p2*<br></b></font>
<b>I want </b> <input name="qty" value="1" size="4" type="text"><b>of these!</b> <br>
<input type="image" src="http://www.*mysite*.com/images/buttons/buy.jpg" border="0" name="submit" alt="Thanks for choosing *product* from *mysite*" width="57" height="27">
</form>
Here's a marquee script I like (removing it makes no difference):
<!-- slogans-->
<script language="JavaScript1.2">
//Translucent scroller- By *another site*
//For full source code and more DHTML scripts, visit [*another...] site*.com
//This credit MUST stay intact for use
var scroller_width='620px'
var scroller_height='25px'
var bgcolor='#E7E7E7'
var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds)
var scrollercontent=new Array()
//Define scroller contents. Extend or contract array as needed
scrollercontent[0]='<i>*slogan1*</i>'
scrollercontent[1]='<i>*slogan2*</i>'
scrollercontent[2]='<i>*slogan3*</i>'
////NO need to edit beyond here/////////////
var ie4=document.all
var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
if (ie4¦¦dom)
document.write('<div style="position:relative;width:'+scroller_width+';height:'+scroller_height+';overflow:hidden"><div id="canvas0" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div><div id="canvas1" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div></div>')
else if (document.layers){
document.write('<ilayer id=tickernsmain visibility=hide width='+scroller_width+' height='+scroller_height+' bgColor='+bgcolor+'><layer id=tickernssub width='+scroller_width+' height='+scroller_height+' left=0 top=0>'+scrollercontent[0]+'</layer></ilayer>')
}
var curpos=scroller_height*(1)
var degree=10
var curcanvas="canvas0"
var curindex=0
var nextindex=1
function moveslide(){
if (curpos>0){
curpos=Math.max(curpos-degree,0)
tempobj.style.top=curpos+"px"
}
else{
clearInterval(dropslide)
if (crossobj.filters)
crossobj.filters.alpha.opacity=100
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=1
nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj.innerHTML=scrollercontent[curindex]
nextindex=(nextindex<scrollercontent.length-1)? nextindex+1 : 0
setTimeout("rotateslide()",pause)
}
}
function rotateslide(){
if (ie4¦¦dom){
resetit(curcanvas)
crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.style.zIndex++
if (crossobj.filters)
document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=20
else if (crossobj.style.MozOpacity)
document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.2
var temp='setInterval("moveslide()",50)'
dropslide=eval(temp)
curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
}
else if (document.layers){
crossobj.document.write(scrollercontent[curindex])
crossobj.document.close()
}
curindex=(curindex<scrollercontent.length-1)? curindex+1 : 0
}
function resetit(what){
curpos=parseInt(scroller_height)*(1)
var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
crossobj.style.top=curpos+"px"
}
function startit(){
crossobj=ie4? eval("document.all."+curcanvas) : dom? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssub
if (ie4¦¦dom){
crossobj.innerHTML=scrollercontent[curindex]
rotateslide()
}
else{
document.tickernsmain.visibility='show'
curindex++
setInterval("rotateslide()",pause)
}
}
if (ie4¦¦dom¦¦document.layers)
window.onload=startit
</script>
HEre's a bookmark link:
<a href="javascript:addBookMark();" onClick="trackClick('1','V32T9','1');" style="text-decoration: none; color:#FFFFFF"> we're your favorite! </a>
And here's everything after the body ends:
<script language="javascript">
function addBookMark() {
if (window.sidebar && window.sidebar.addPanel) {
window.sidebar.addPanel('*mysite*.com ¦ The absolute coolest soap', 'http://www.*mysite*.com','');
} else {
window.external.AddFavorite('http://www.*mysite*.com','ilovemiceelf.com : Handmade bath, body, and spa products.');
}
}
function clearMe(field) {
if (field.value == "enter email for sales events") {
field.value= "";
}
}
</script>
<!-- Start of StatCounter Code -->
<script type="text/javascript" language="javascript">
var sc_project=908512;
var sc_invisible=1;
var sc_partition=7;
var sc_security="20c9f1c2";
</script>
<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c8.statcounter.com/counter.php?sc_project=908512&java=0&security=20c9f1c2&invisible=1" alt="free log" border="0"></a> </noscript>
<!-- End of StatCounter Code -->
Jeez, what a mess. If anyone could sticky me, I'd love to provide the URL, and have someone take a direct look. Thanks in advance for any help!
Also, you state that "the line just before this one" causes an object expected error. How do you know that it is that line? The reason I ask is that if you are relying on the line number returned in the standard javascript error, then it could be referring to a line in one of the external javascript files. Regardless of which file the error occurs in, the error will show the primary resource (your html file) as the file.
Object expected means you are utilizing an identifier that has not been defined or declared.
A common cause is that you are calling a function in an external file, but the external file has not been loaded for some reason. Check your log file to see if your server is returning 404 (file not found) server codes for your javascript files.
Another common cause is that the javascript within a script block cannot be properly parsed, so one or more of the functions are never created. When some subsequent code calls the functions they don't exist, and javascript throws the object expected error.