SOLVED: JavaScript Question - but why?

by Stephen Johnston <pepe(at)gainsay.com>

 Date:  Fri, 07 Apr 2000 15:46:20 -0700
 To:  hwg-techniques(at)mail.hwg.org
  todo: View Thread, Original
Hello Group-

I posted this question earlier, but then later solved it. Since I sent the 
question with the wrong personality it never made it to the list. It's been 
a long day.
However, the way I solved it was not the way I expected. I ended up having 
to move my JavaScript functions into the body of the page. Which seems 
weird to me since I have never done it that way. Could someone please read 
the following post and tell me why moving the Javascript into the body 
solved it?

TIA

-------------- Attempted Post :) --------------------

I am kinda getting annoyed by this. It has been a while since I did 
client-side scripting and I am totally having brain fade here. Can someone 
help me on this:

I have this script block:

<SCRIPT LANGUAGE="JavaScript">
<!--
	//category.asp?action=move&direction=down&ID=12
	function moveItemUp()
	{
		var URLToGo = "category.asp?action=move&direction=up&ID=";
		var moverID = 
document.mainCat.mainCatList.options[mainCat.mainCatList.selectedIndex].value;
		URLToGo = URLToGo + moverID;
		window.location=URLToGo;
	}
//-->
</SCRIPT>

Called by this button:

<input type="button" value="Move Up" onClick="moveItemUp()">	

When I press the button it stops at the function call moveItemUp() and says 
object expected.  Every example I could find had this exact same syntax, 
what am I doing wrong?

-Stephen Johnston

================================================
President
Gainsay.com, Inc.
http://www.gainsay.com/
Database Driven Internet Application Development

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA