Forum Moderators: open

Message Too Old, No Replies

Object expected error

         

antiglack

2:09 pm on Feb 22, 2007 (gmt 0)

10+ Year Member



Hi,
I am a newbie and know just enough to really mess things up. I have used dreamweaver to put together my website. I am getting an error icon on the homepage I recently published as a test. When I click on it states "object expected" then it lists a line number 16 character 1.
does any one have any advice? Remember that I know next to nothing about web development.

Thanks.

[edited by: jatar_k at 2:22 pm (utc) on Feb. 22, 2007]
[edit reason] no urls thanks [/edit]

cmarshall

8:04 pm on Feb 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That error generally refers to a variable being empty when it should have a value. There are any number of reasons why it could be empty. Usually, it's a typo or failing to use document.getElementById() (people often reference the element directly, which SOMETIMES works).

rocknbil

8:59 pm on Feb 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard anitglack, possible physical items that may be giving you trouble:

Am empty element can be a page object or an entire javascript function. If Dreamweaver has put your javascript in an external file and you didn't upload it, this can also be the cause.

Look for the code for the object you are clicking, you can find this in the Code View (? think that's what it's called) window, it will be something like

<a href="someurl.html" onClick="some_MM_function()">Some URL</a>

Both of the above are examples - but if it comes from Dreamweaver, the Javascript will have "MM" in it somewhere. :-)

If the "some_MM_url" is in your document somewhere, then it's something else. What you are looking for here is anything that says "onClick." Toward the top of your document, if you see something like

<script type="text/javascript" src="some-file.js"></script>

This means that Dreamweaver has externally linked the javascript in a separate file. Make sure it's uploaded to your server.

antiglack

7:07 pm on Feb 23, 2007 (gmt 0)

10+ Year Member



Hey thanks for the help!
I changed line 16 in the Template from:

<body bgcolor="#000020" text="#FFFFFF" link="#FFFFFF" vlink="#999999" alink="#7BB8FB" leftmargin="20" topmargin="5" marginwidth="0" marginheight="0" style="margin: 0" onLoad="writeMenus()" onResize="if (isNS4) nsResizeHandler()">

To:

<body bgcolor="#000020" text="#FFFFFF" link="#FFFFFF" vlink="#999999" alink="#7BB8FB" leftmargin="20" topmargin="5" marginwidth="0" marginheight="0" style="margin: 0">

And all the pages are fixed! Thanks :)

cmarshall

7:25 pm on Feb 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That fixed it because it doesn't call the JavaScript anymore. However, if you write functions that use JavaScript (like rollovers), then you may have the problem again.