Page 1 of 1

javascript says my function doesn't exist

Posted: Wed Aug 30, 2006 12:23 pm
by daedalus__
i have some code:

Code: Select all

<html>
<head>
<meta/>
<title></title>
<script type="javascript">
function toggle()
{
// show or hide div depending on what display is set to
}
</script>
<style>
@import blah.css
</style>
</head>

<body>
<a onclick="javascript: toggle()">toggle div</a>
<div id="toggleme">blah blah blah</div>
</body>
</html>
Internet Explorer gives the error: "Object expected"
Firefox says that the function doesn't exist.

I tried changing the function name, placing it in different parts of the page, and copying functions and calls that I know work from other pages.

Nothing works, same two errors, every time.

I don't know what is wrong.

Posted: Wed Aug 30, 2006 1:41 pm
by Weirdan
<script type="text/javascript">
<a onclick="toggle()">toggle div</a>

Posted: Wed Aug 30, 2006 3:21 pm
by daedalus__
I'm retarded.

:roll: :roll: :roll:

I meant to say language.

Thanks Weirdan