How to access the values java to javascript?

Showing Answers 1 - 2 of 2 Answers

Yogesh Kumar

  • Oct 21st, 2005
 

<%

   String str = "123";

%>

<script>

    function f()

     {

         alert('<%=str%>');

      }

</script>

  Was this answer useful?  Yes

Amjad

  • Nov 17th, 2005
 

We can access the Java values in javascript like above mentioning.coz,javascript is using for client side validation,etc  in webpages like HTML. So,this(JavaScript) is  not allow in any languages which is not supporting to create the webpages. In case of Java Technology we have the dynamic HTML  i.e JSP so we can encapsulate the JavaScript in this.and use as we want.and we can perform some client side validation using the javascript embed in JSP

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions