This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes converting class variable to javascript variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "converting class variable to javascript variable" Watch "converting class variable to javascript variable" New topic
Author

converting class variable to javascript variable

puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32
is there a way in which i can convert class variable to javascript variable.If so how..?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

What class variable? In a Java class? Please TellTheDetails -- we can't guess what you are doing.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
puja shaw
Ranch Hand

Joined: Nov 06, 2012
Posts: 32
Bear Bibeault wrote:What class variable? In a Java class? Please TellTheDetails -- we can't guess what you are doing.



java class variable.Mr bill i am getting only questions and suggestions from you rather than solutions.Sorry to say this but its true.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

When you do not provide enough details to answer your question, then in order to help you, more questions need to be asked. If you want help, you will answer those questions. Otherwise, it's hard to provide any help.

"Mr bill"?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

If this is in a JSP (guessing), than you cannot really "convert" the value, but you can use JSP to dynamically create the JavaScript code to create a JavaScript variable with the same value.

For example:
If the value of someScopedVariable is (let's say) 213, the result would be the following in the HTML sent to the browser: var aVariable = 213;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: converting class variable to javascript variable
 
Similar Threads
Using script variables in JSP
How to assign a javascript variable to java varisble?
assign return value of function from javascript to variable in jsp
Access java script variable from a java file
Can Javascript variable store into JSP variable