Communicating between applet and browser

0 views
Skip to first unread message

Dan Watling

unread,
Oct 19, 2009, 9:14:24 AM10/19/09
to PulpCore
I've got a "close" button in my pulpcore applet which I would like to
have forward to another page. How can I go about doing this?

I would assume I would need to send a command back to the browser
which would intercept it with JavaScript which then forwards to the
correct URL, but I have no idea how to do this with pulpcore. Any
thoughts on the matter would be appreciated.

-Dan

Alexandre BRAGANTI

unread,
Oct 19, 2009, 10:14:55 AM10/19/09
to pulp...@googlegroups.com
That's it: applet calls a Javascript which will be executed in the browser.
I did it a long time ago to use (chat, ...) the right part of the
'Bounce It' game ( here: http://multijoo.no-ip.org ).

The feature is usually called 'LiveConnect' (ie. Applet <=> Javascript
interaction). It may help for google search ;-)
Things needed are already present in pulpcore : it is -among other- used
to show the pulpcore applet when it's loaded if I remember well.

Below, a sample line of code to call a javascript function present in
the webpage:

((AppletAppContext)(AppletPlatform.getInstance().getThisAppContext())).callJavaScript("myfunction",
myOptionalParameterObjectLikeAString);


Best regards,

Nouk²



Dan Watling a écrit :

Dan Watling

unread,
Oct 19, 2009, 1:43:39 PM10/19/09
to PulpCore
Very nice, thank you!

-Dan
Reply all
Reply to author
Forward
0 new messages