• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can we pass Java objects to Java Script

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic