Click to See Complete Forum and Search --> : Java Server Pages and javascript


Paul Trimming
March 23rd, 2002, 09:49 PM
Hello,
I am beginning JSP web work, and I have found no problem with most of the serverside work; I am now trying to write some clientside javascript functions, and I find I want to refer to JSP serverside variables, and on occasion I want to call selected JSP server side methods.

I don't know how to do this. I was always able to refer to things serverside from the client with ASP and Javascript!

Can anyone help with this basic problem????

Paul Trimming

websmith99
September 30th, 2002, 04:09 PM
The point of JSP is that you can mix and match client and server side code so long as you use the delimiters.

Example:

<script language="JavaScript" type="text/javascript">

function foo(bar) {
if (bar == "<%=jspvariable%>'') {
alert ("they match");
}
}

</script>

Could you provide a scenario in which this did not work?