Click to See Complete Forum and Search --> : pass query results to javascript


dkirk
03-11-2008, 09:19 PM
I have a simple peice of javascript that resides in an aspx page that calls a function:

<script language="JavaScript" type="text/javascript">woodIsLife();</script>

I would like to store the name of the function in a sql database and then populate the javascript with the function name depending on search criteria. Is there a way to pass the query results to the javascript? something like this (in the example, functionName would be the name of the column from the db. there would only be one result):

<script language="JavaScript" type="text/javascript"><% Eval("functionName") %>script>

chazzy
03-12-2008, 07:31 AM
i hate to ask this - but can't you put some conditionals into the javascript? i personally would think that this could cause some headaches to debug.