> -----Original Message-----
> From: A mailing list about Java Server Pages specification
> and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Srihari Chandana
>
> Hello all,
>      Iam wondering whether I can use server side script to dynamically
> generate functions inside SCRIPT and /SCRIPT tags.Iam using a
> code which
> looks like this.
> <SCRIPT language="javascript">
> ........
> <% for(int k=1;k<10;k++) { %>
>
> function myfunc_<%=k%>() {
> //somecode in here
> }
>
> <% } %>
>
>
>
> ..........
> </SCRIPT>
> When I load this jsp page, Its giving a runtime error called "syntax
> error".
> If I ignore that error and view the source, it is showing the
> 10 functions
> myfunc_1,myfunc_2 ....etc.
> Is it actually possible to generate functions like this?
> Please write back if anyone knows.This thing works in an ASP page!!!

I do this sort of thing all the time, what you have shown /looks/ fine.

Surely looking at the generated source and the line number, indicated by the
error, will tell you what's wrong?

Steve S

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to