Javascript question

Hi,

I have one jsp file and two javascript files like

*** a.jsp********

<html>

<head>

</head>

<body>

<%! String a = "BBH" %>

<script src= b.js></script>

<script src = c.js></script>

</body>

</html>

************* b.js***************************

var str = <%= a %> ;

var c= str + "BOSTON";

***************** c.js**********************

document.write(c);

I want the same functionality.

But I don't know how to pass parameters from a.jsp to b.js and from b.js to c.js

or is there any other way ?

Thanks,

-Priya

[754 byte] By [Priyam] at [2007-9-26 2:21:56]
# 1

How to pass parameters from a.jsp to b.js and from b.js to c.js with jsp I don't know, but you can do the following:

*** a.jsp********

<html>

<head>

</head>

<body>

<script>

var a = <%= "BBH" %>;

</script>

<script src=b.js></script>

<script src=c.js></script>

</body>

</html>

************ b.js*********************

var str = a ;

var c = str + "BOSTON";

*************** c.js**********************

document.write(c);

jaojao at 2007-6-29 9:27:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
thank you !its workingI have one more question can I write jsp:include inside javascript ?I mean document.writeln("<jsp:include page='AW_Menu.jsp' flush ='true' />");can I write like this ?
Priyam at 2007-6-29 9:27:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...