Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Browser evaluate always returns null IE7(Browser evaluate always returns null IE7)
Browser evaluate always returns null IE7 [message #663545] Tue, 05 April 2011 14:58 Go to next message
Jay Mising name is currently offline Jay Mising nameFriend
Messages: 11
Registered: July 2010
Junior Member
Hi all,

I'm trying to get a return value from the swt browser widget using browser.evaluate.

Here is my java code:

display.asyncExec(new Runnable()
		{
			
			
			@Override
			public void run()
			{
				Object o = browser.evaluate("fromJava('hello');");
				System.out.println(o);
				
			}
		});



Here is the html page:
<html>
<head>
<script type="text/javascript">
function fromJava(val)
{
	alert(val);
	return 'hello from javascript';
}

</script>
</head>

<body>


<p>Something...</p>
</body>
</html>



If i run this command it will return 4:

browser.evaluate("return 2+2;");


Any ideas?
Re: Browser evaluate always returns null IE7 [message #663581 is a reply to message #663545] Tue, 05 April 2011 17:10 Go to previous message
Jay Mising name is currently offline Jay Mising nameFriend
Messages: 11
Registered: July 2010
Junior Member
So it looks like this works, but i'm not sure why i have to explicitly specify the return statement.

Object o = browser.evaluate("return fromJava('hello');");
Previous Topic:Drag and Drop between two Trees
Next Topic:Eclipse 3.6.2 SWT issue - .UnsatisfiedLinkError: Activator._isCompizSet()Z
Goto Forum:
  


Current Time: Sat Apr 20 00:06:53 GMT 2024

Powered by FUDForum. Page generated in 0.02824 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top