SUBSCRIBE JSP-INTEREST Lennie Gu wrote:
> I know we can import external javascript in html pages. But I tried
 > to import the javascript in JSP, it seems that it can't work.  May I
 > know is it posible to do it?  how should I do it?  I need the
 > javascript to do some common input validations.  Thanks.

You do it exactly as you do it in a regular HTML page, with a
<script src="myscript.js"> HTML element.

Remember that to JSP, this is just "tempate text" that it passes on
to the browser without even trying to understand what it means, and
that the browser has no idea that the HTML response is generated by
JSP.

In general, questions like "how do I use this <insert your favorite
HTML or JavaScript feature> in JSP" don't make much sense; HTML and
JavaScript are interpreted by the browser, and JSP is not involved
in the processing of elements of this type at all. If you look at it
this way, it's easier to figure out where to look for an answer.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
JavaServer Pages        http://TheJSPBook.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to