NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 21, 2017, 02:49:00 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
An interaction between two opposites produces a unique outcome. ..."Jules Henri Poincare(1854-1912, One of France's greatest mathematicians)"
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: JSObject  (Read 7202 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Jimmy Lefort
Newbie
*
Offline Offline

Posts: 3

«
Embed this message
on: April 10, 2009, 05:10:53 pm » posted from:Romagnat,Auvergne,France

Hi

I am a french student in an engineering school. I am using ejs to make some java applet. I would like to make my java applet communicate with an html web page. For that, I need to use a JSObject in my applet. ( http://java.sun.com/products/plugin/1.3/docs/jsobject.html)

I have imported the JSObject library in ejs, but my problem is that  ejs seems to not recognize the JSObject and all functions.

Do you know if it is possible to use a JSObject with ejs?

Thanks,

Jimmy Lefort
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: April 10, 2009, 08:15:58 pm » posted from:Taipei,T\'ai-pei,Taiwan

Please let me know what you want to do?
Do you want to call EJS with Javascript or do you want to call Javascript from EJS?
Logged
Jimmy Lefort
Newbie
*
Offline Offline

Posts: 3

«
Embed this message
Reply #2 on: April 10, 2009, 09:11:06 pm » posted from:Romagnat,Auvergne,France

Hi,

Actually, I would like to send a value (an integer for example) from my Java applet to the javascript code. I have seen on the web that it is possible with a JSObject. Do you know if it is possible to do that with ejs?

Thanks a lot for your help.

Jimmy LEFORT
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #3 on: July 27, 2009, 09:56:02 pm » posted from:Taipei,T\'ai-pei,Taiwan

It will be much easier to get value in EJS with javascript call.
All the variables defined in EJS model can be access directly with javascript call.
For example:
if the name in applet tag is ejscode (name='ejscode')
And there is a variable call dt in ejs model.
You can get dt value with the following call:
dt=document.ejscode._model.dt;

Please check out Quiz: Do you know when two particles have the same horizontal speed?

I added JSObecj to EJS version 3 so that I can call javascript in the same html page from EJS simulation.
It was only work for Internet Explorer and it is not working for netscape at that time.
However, the code has been disabled in the current version.
It is at the end of org/colos/ejs/library/simulation.java
You can try to enable the code and re-compile it again if you really need it.
Logged
Pages: [1]   Go Up
  Print  
An interaction between two opposites produces a unique outcome. ..."Jules Henri Poincare(1854-1912, One of France's greatest mathematicians)"
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.047 seconds with 22 queries.since 2011/06/15