technically, it should be...


<%
String yourjavavariable = "goodbye world";
%>

<script language="JavaScript" type="text/javascript">
        //javascript code below this line
        var javaScriptVar = "<%= yourjavavariable %>";

        function showjavaScriptVar(){
                alert("javaScriptVar=" + javaScriptVar);
        }
        window.onload = showjavaScriptVar();

</script>

note the intercaps: for the <script> tag to be xhtml compliant it has to
look like this.

vora

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of VENKATACHALAPATHY
Duraiswamy
Sent: Thursday, May 03, 2001 10:34 AM
To: [EMAIL PROTECTED]
Subject: Re: JSP and Java script


You will also need to take care of assigning runtime values for the
javascript variables, if you have any.


Thanks
Venkat

        -----Original Message-----
        From:   Vani V. [SMTP:[EMAIL PROTECTED]]
        Sent:   Thursday, May 03, 2001 6:40 PM
        To:     [EMAIL PROTECTED]
        Subject:        Re: JSP and Java script

        Hi,
                Eduardo was right. You can put it like your HTML. If you
still
        want the actual syntax I have given it below.

        <script language="javascript">
        Put your javascript code here
        </script>

        Regards,
        Vani V

        -----Original Message-----
        From: Nikhil Singhal [mailto:[EMAIL PROTECTED]]
        Sent: Thursday, May 03, 2001 3:18 PM
        To: [EMAIL PROTECTED]
        Subject: JSP and Java script


        Hi all,
        How can I add Java script code in my JSPs?
        Suppose I have a JSP which displays an HTML form and it also has
some
        JSP
        code for doing some DB retrival for the form. I need to verify some
        fields
        using Java script.
        How can I do it?
        Thanks
        Nikhil


========================================================================
        ===
        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://java.sun.com/products/jsp/faq.html
         http://www.esperanto.org.nz/jsp/jspfaq.html
         http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
         http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


===========================================================================
        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://java.sun.com/products/jsp/faq.html
         http://www.esperanto.org.nz/jsp/jspfaq.html
         http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
         http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
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://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
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://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to