Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

returning values from javascript function to java

 
sarah cruz
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic