-
NEED HELP: Passing a Java String array to JavaScript
Hi,
This might not be the right discussion forum (it was either this or Java),
but I need to pass a String array from Java (JSP) to JavaScript...
Any ideas?
Thanks in advance.
-
Re: NEED HELP: Passing a Java String array to JavaScript
You could possibly place the array in a cookie. That way they can both
access it.
Gugo <gugo46@hotmail.com> wrote in message
news:3c03f1b3$1@147.208.176.211...
Hi,
This might not be the right discussion forum (it was either this or Java),
but I need to pass a String array from Java (JSP) to JavaScript...
Any ideas?
Thanks in advance.
-
Re: NEED HELP: Passing a Java String array to JavaScript
Another way of doing this is by generating the javascript string array in
the JSP.
An example code snippet for doing this in a JSP is:
<script language="javascipt">
<!--
Var jsStrArray = new Array();
<%
for (int i=0; i < 10; i++) {
out.println(" jsStrArray[" + i + "]=" + javaStrArray[i]);
}
%>
//-- Now do something useful with the Javascript array jsArray
//-->
</script>
Cheers,
Rajeev
"Bronwyn Streeter" <bronwyn@digitalzoo.com.au> wrote:
>You could possibly place the array in a cookie. That way they can both
>access it.
>
>Gugo <gugo46@hotmail.com> wrote in message
>news:3c03f1b3$1@147.208.176.211...
>
>Hi,
>
>This might not be the right discussion forum (it was either this or Java),
>but I need to pass a String array from Java (JSP) to JavaScript...
>
>Any ideas?
>
>Thanks in advance.
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks