how to access the java class in javaScript
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ravi_Kumar
Posted On:   Wednesday, May 19, 2004 11:55 PM


i ma having java object in JSP i want to acess the object n javascript is it possible or not if not please mail me how to do.
thanks in advance for your mail.

Re: how to access the java class in javaScript

Posted By:   Sean_Owen  
Posted On:   Thursday, May 20, 2004 11:27 AM

This is not possible -- Javascript executes on the client browser, while your JSP and Java objects live and run on the server.



You could do something like generate Javascript dynamically using values from a Java object:




alert('The value of fooBar on the server is: <%=fooBar%>');


... but this is not quite "accessing the object in Javascript" -- you couldn't modify the object using Javascript for example -- it's just generating Javascript dynamically on the server-side. Maybe that is sufficient though.

About | Sitemap | Contact