This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes returning values from javascript function to java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "returning values from javascript function to java" Watch "returning values from javascript function to java" New topic
Author

returning values from javascript function to java

sarah cruz
Greenhorn

Joined: Sep 21, 2005
Posts: 10
hello, i have a function in javascript which returns a string. how do i access this string outside of my script, for example in java? thanks.

here is an example:

void main () {

String code = "x.onklick = function () { display () }"
browser.execute (code);
}

function display () {
return ("hello");
}

the question is how do i access the string returned by display after browser.execute? i.e., outside the script itself. thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
Java and JavaScript work on two different levels. By the time the JavaScript is executed, the Java has been completed. You would have to submit a form or use Ajax to send the data back to the server.

Eric
[ May 31, 2006: Message edited by: Eric Pascarello ]
 
 
subject: returning values from javascript function to java
 
Similar Threads
Calling Javascript function from Java Code
javascript inside java
on mousedown event
display text string with Javascript on screen
Javascript accessing jsp variable