I have two different JSPs that the Java server combines together and sends back to the same displayed HTML page.
Each JSP has its own <script> block and defines functions inside this block:
JSP # 1:
<script type="text/javascript"> function blah() { ... } </script>
JSP # 2
<script type="text/javascript"> function foo() { blah(); } </script>
As I said, the backend adds them to the HTTP response and sends them back to the browser during the same request.
When I launch this page in my browser, I can immediately say that blah() not executed when foo() called. I see that the console error in Firebug with blah() not defined. I am wondering if blah() only has an area inside its <script> , and also for foo() . Is this the case here or is something else wrong?
When I turn to viewing the source of the page, I see both script blocks and both functions. This tells me that everything is generated / displayed correctly on the server side, but perhaps my approach is inherently wrong (defining functions inside different script tags). Thanks in advance.
source share