Whatever, I think that it is possible to do this. I have just tried this:
<%
  String bla = "he he he he bla!";
%>
<script language="JavaScript">
  alert("<%= bla %>");
</script>

and it worked. I think you just have missed the quotes around <%= %>
element.

Regards, Stefan.

>From: Selvamani Jayakumar <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Can i use java objects in Javascript
>Date: Tue, 5 Sep 2000 11:09:26 IST
>
>hi leena
>
>u cannot embed JSP tag inside a Javascript Function.
>if it is a client side validation , u dont need to get the
>Error Message from Server. Instead of having a interface , u can store it
>as
>a Constant variable like "var MSG01" , u store all these constants in a
>separate javascript file and u can include in ur JSP program.
>
>
>
>
>
>
>>From: Leena Albert <[EMAIL PROTECTED]>
>>Reply-To: A mailing list about Java Server Pages specification and
>>     reference <[EMAIL PROTECTED]>
>>To: [EMAIL PROTECTED]
>>Subject: Can i use java objects in Javascript
>>Date: Mon, 4 Sep 2000 10:16:34 -0000
>>
>>Hi,
>>        In JSP, I would like to use instances in JavaScript using JSP
>>tags.
>>Will it be possible?
>>
>>  I am having a interface Which declares constants, i.e, fields like
>>MSG01="You have to fill the textbox". In javascript, on field validation,
>>if i call the message with instance msg as <%= msg.MSG01 %> it, gives
>>"object undefined error".
>>How can i access it in javascript, as i need to declare the error
>>messages(MSG01) in interface?
>>
>>form name=actform and textbox name = txt1,
>>
>>Code is
>>------------------------------------
>>if (actform.txt1==""){
>>alert(<%= msg.MSG01 %>);
>>}
>>
>>Thanks in advance,
>>
>>A.Leena
>>
>>_________________________________________________
>>Get Your Free Email At, http://www.rediffmail.com
>>
>>Partcipate in crazy Re.1 auctions at http://www.rediff.com/auctions
>>
>>===========================================================================
>>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>>JSP-INTEREST".
>>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
>
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>Share information about yourself, create your own public profile at
>http://profiles.msn.com.
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>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

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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