• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can we pass Java objects to Java Script  RSS feed

 
nalini peddareddy
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sujith Kanaparthi
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Satish SN
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!