I try to do something like that 1.
<head><% out.println("<script type=\"text/javascript\">"); out.println("function myfunction(){"); out.println("for(int i=0;i<10;i++){"); out.println("alert(message+i);"); out.println("}}"); out.println("</script></head>"); %>
and use it like that
<body><input type="button" value="abcd" onclick="myfunction();"/></body>
That is generate javascript within my jsp Pages.And it works fine but only in chrome and not in IE.I then tried this 2.
<head><%StringBuffer dynamicJavaScript = new StringBuffer();dynamicJavaScript.append("\n<script type=\"text/javascript\">");dynamicJavaScript.append("\n</script>");%></head>
and use it like that again inside the tag
<%=dynamicJavaScript%>
In a weird way only if i include both of these solutions (1. & 2.) it works in IE. Have yoy got any ideas? Thank you