You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

luismator

Beginner

  • "luismator" started this thread

Posts: 2

Date of registration: Dec 3rd 2012

  • Send private message

1

Monday, December 3rd 2012, 4:22pm

How to return value to web page from applet?

Hello,



I am building some java games (applets made with jabaco) and I upload them in a website

http://www.ahorachina.com/juego_numeros_chino_1a.html



When a player finish one of the games (with proper score) I want to make accesible new games (new html-php pages), so I need the applet return a value to the html-php page when this ocurs.



Please, do you know how to return a value to html-php page from an applet?



Thanks in advance

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

2

Monday, December 3rd 2012, 7:09pm

RE: How to return value to web page from applet?

Please, do you know how to return a value to html-php page from an applet?


I have googled and find this sides about it:
[ http://docs.oracle.com/javase/1.4.2/docs…de/java_js.html ]
[ http://www.raditha.com/java/alert.php ]

Edit: This side is better then the second of the two last links:
[ http://www.raditha.com/java/mayscript.php ]

At first you need to add plugin.jar to your Jabaco-Classpath:
- Press [F1]
- Press on Button "Add Jar-Archive..."
- Add plugin.jar from your JRE-directory. For example: C:\Program Files\Java\jre7\lib\plugin.jar

then a

Jabaco Source

1
2
3
Dim win As netscape#javascript#JSObject
win = netscape#javascript#JSObject.getWindow(Me)
win.call("f", Nothing)

should work. But win.call gives out an cokmpiler error.
Haven't actually not the time to look more special to it. But something like that should be working.

Greatings
theuserbl

This post has been edited 1 times, last edit by "theuserbl" (Dec 3rd 2012, 7:30pm)


theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

3

Monday, December 3rd 2012, 7:12pm

Ok, win.call needs a String and an Object-Array:

Jabaco Source

1
2
3
4
Dim o(4) As Object
Dim win As netscape#javascript#JSObject
win = netscape#javascript#JSObject.getWindow(Me)
win.call("f", o)


this compiles.

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

4

Monday, December 3rd 2012, 7:23pm

the win.call ist similar like reflection.
The problem is, that "Nothing" don't working as an replace for an array.

Currently I see only the possibility to create a little Java-file which have an method in which it calls the win.call.
And then access this method from Jabaco.

But at first you need to write the Javascript part, to have a function, which will be called by win.call.

Greatings
theuserbl

Rate this thread
WoltLab Burning Board