Hi All, I would like to know if there is a way for adding a javascript 'alert' button in JSP such that the alert button appears on the same JSP page.Right now iam able to get the alert message on a different page. similarly can i add/embed JSP code(i.e, scriptlets/beans) in Javascript?? Any other ideas/suggestions to do the same ? Thanks, Rashmi
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
Lets remember what Javascript is - a scripting language written into a HTML page and executed on the browser side. Anything you can create in Javascript on a plain HTML page can also be created on a HTML page written by JSP - the trick is getting the syntax and quote marks escaped properly. Also remember what JSP is - a language for creating servlets on the server side based on a mix of HTML, special tags, and Java code. Any Java code you "embed in Javascript" will be meaningless on the browser side. Bill
Technically, JSP is a language, depending on what your definition of language is. The fact that it is then interpreted into Java is of little concern, but the fact that it has to be interpreted surely indicates that an argument exists for it to be denoted a language in its own right. That detail is of little relevance to the above post. I would, however, add to Bill's post, just to be explicit that JSPs are not restricted to producing HTML (though clearly that is the scope of this thread) Jesse - with pedantic hat
---<br />Time flies like an arrow,<br />Fruit flies like a banana