Faqts : Business : Programming : Shopping For You : Java : JSP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

68 of 123 people (55%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

How do I include a javascript in a JSP pages where I need to use alert() function?

Jul 24th, 2002 15:17
kAt v,


The same way as you would include a javascript in a regular html page. 
Just make sure that your <script> tags are outside the jsp tags.

ex.
<html>
<body>
<% .... some jsp code ... %>

<script language="javascript">
    document.alert("some alert");
</script>

<% ... more jsp code ... %>
</body>
</html>