Forums Register Login

Can we pass Java objects to Java Script

+Pie Number of slices to send: Send
Hi,


Just need to know some info if at all we can pass a java object(Hashtable) to a Java script.


Please help me out ...very urgent...


Regards,
Nalini.
+Pie Number of slices to send: Send
Hi Nalini,

I'm not very clear about your query but You can use java object in java script.
you can assign like this:
var str = '<%=someString%>';
or else if you want to manipulte some java object inside java script you can place that in scriplets(like <%......some java statements.....%> .Hope this may solve your problem.

Reagrds,
Sujith
+Pie Number of slices to send: Send
 

Originally posted by nalini peddareddy:
Just need to know some info if at all we can pass a java object(Hashtable) to a Java script.



Nalini, can you just tell what do you want to achieve? May be we can suggest better way to achieve the same.
+Pie Number of slices to send: Send
Nalini,

U cannot pass Java objects to JavaScript

we can try alternative ways of declaring javascript variables and then assigning java primitive datatypes as values to JS variables.

as chetan told if u tell us ur problem statement we can help u in finding the alternative way
+Pie Number of slices to send: Send
kumar,

Thank you for responding to this question.

Please take a moment to read the following entry in our FAQ regarging the use of abbreviations such as "U" and "R" in place of "You" and "Are".
http://faq.javaranch.com/view?UseRealWords
One you are done reading it, we would all be grateful if you would fix your response in this thread.

thank you,
-Ben
I am going to test your electrical conductivity with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 921 times.
Similar Threads
Dealing with client-side changing of code
How to Pass Value from struts Action class to java script
passing parameters between JSF(or JSP) and java script
Communication between Java and Perl
how to get queryParameter from Request?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 19:46:20.