simple alert message in JSP

J

Jason

Hi,

In JavaScript there's a function alert() which will pop a small screen to
alert something. But I don't know if we have an alert function like that.
Any help will be appreciated.

Jason
 
A

Anders =?iso-8859-1?Q?Engstr=F6m?=

* Jason said:
Hi,

In JavaScript there's a function alert() which will pop a small screen to
alert something. But I don't know if we have an alert function like that.
Any help will be appreciated.

JSP == Java *Server* Pages. The JSP is executed on the server by the
servlet container - not on the client (JavaScript otoh is executed by
the webbrowser). To show an alert-box you'll have to use JavaScript. The
script can, of course, be greated by the JSP:

Some.jsp
==========
<html>
<head>
....
<script>
showTime()
{
/* Shows a box with the current server date */
alert(<%=java.util.Date()%>);
return true;
}
</script>
</head>
<body>
<a href=".." onclick="showTime();">Show time on server</a>
</body>
</body>

The above is probably not syntax correct javascript - but you get the
idea.

//Anders



--
/**
* Anders Engström, (e-mail address removed)
* -------------------------------------
* Your mind is like an umbrella.
* It doesn't work unless you open it.
* /Frank Zappa
*/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,174
Latest member
BlissKetoACV
Top