aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes assigning java variable in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "assigning java variable in javascript" Watch "assigning java variable in javascript" New topic
Author

assigning java variable in javascript

prasanna mr
Greenhorn

Joined: Jan 24, 2008
Posts: 4
how can we assign java variable in javascript?Is there any example?
it's urgent..
Lave Kulshreshtha
Ranch Hand

Joined: Oct 21, 2007
Posts: 106
In order to assign a java variable to javascript variable. javascript method should be present in a JSP file, following is the example

<script>
var temp = <%=javaVariable%>
</script>

-Lave

Originally posted by prasanna mr:
how can we assign java variable in javascript?Is there any example?
it's urgent..


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, ITIL V3 Foundation Certification
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

"prasanna mr", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Originally posted by prasanna mr:
it's urgent..

Please read this for information on why this isn;t a good idea.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: assigning java variable in javascript