PDA

View Full Version : Error: Object Expected & Syntax Error what do these mean?


DiarYofaMadmaN
04-03-2004, 06:49 PM
Error:
Line: 10 & 26
Char: 1
Error: Object Expected & Syntax Error
Code: 0
URL: http://maxforcepc.ath.cx:81/maxforcepc/css/index.htm

Url to the page is above in URL:

Function:

function leftnav(linklist) {
/*document.getElementById('cell-title').innerHTML+="<img src=\""+toptitle+"\">";*/
if (document.getElementByID('linksleftfloat').innerHTML) != null { document.getElementById('linksleftfloat').innerHTML = ''; document.getelementById('linksleftfloat').innerHTML+=linklist; }
else { document.getElementById('linksleftfloat').innerHTML+=linklist; }
}


Link which calls the function:

<area shape="rect" coords="513,125,590,135" href="#" onClick="leftnav('<UL><LI>1st element of list</LI><LI>2nd element of list</LI></UL>'); return false;">


The Syntax error I think has to do with the if statement and the Object expected has to do with the link calling the function....

It's like everytime I actually get something to work I run into another problem.

Willy Duitt
04-04-2004, 12:29 AM
You are prematurely closing your conditional statement.

if (document.getElementByID('linksleftfloat').innerHTML) != null )

.....Willy

glenngv
04-05-2004, 08:45 AM
...and typo:

document.getElementByID('linksleftfloat')

That should be a small d.