APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Reading and setting variables through javascript

Return to the EJS Modeling forum
Login to post to this thread

How to get and set variables from the html page
George Barouxis
6 Posts

I have just completed the conversion of a java simulation to javascript. However, I cannot find a way to read and set values of variables and elements from the html page. In the old java flavour we used

NameOfApplet._setVariables('variable=x')

and

NameOfApplet._getVariable('variable')

With ejss I cannot do this. I found the pdf with the instruction for using e.g.

_view.plottingPanel.setProperty("Display","none");

but it does not work when used in the head of the document, gives error "_view is not defined".

What is the correct way to do this, get and set variables of the simulation from the html page?

Thanks in advance

George


Current Replies - View all
Re: How to get and set va...   (John Val - )
Re: Re: How to get and se...   (Francisco Esquembre - )
Re: Re: Re: How to get an...   (George Barouxis - )
Re: Re: Re: Re: How to ge...   (John Val - )
Re: Re: Re: Re: Re: How t...   (George Barouxis - )
Re: Re: Re: Re: Re: Re: H...   (John Val - )
Re: Re: Re: Re: Re: Re: R...   (Francisco Esquembre - )
Re: Re: Re: Re: Re: Re: R...   (George Barouxis - )
Re: Re: Re: Re: Re: Re: R...   (Francisco Esquembre - )
Re: Re: Re: Re: Re: Re: R...   (George Barouxis - )
Re: Re: Re: Re: Re: Re: R...   (John Val - )
Re: Re: Re: Re: Re: Re: R...   (George Barouxis - )
OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book