#345 Jmol and Javascript

closed
nobody
None
5
2006-03-31
2006-03-22
No

Hello.

Could it be posible to pass variables between
applications, like the actual script selected in a
JmolMenu object to a jmolLink. I've created a function
to make a clickable image in Jmol.js based on the
jmolLink function. I use it to load new data into the
applet, I would like to pass data from other controls,
like menus into this function along with the script I
use it for.

For example the value propertie from the select in the
jmolMenu function is an script Index instead of the
actual value.

I could do this by calling some objects in javascript
within a function:

document.myform.jmolMenux.options[document.myform.jmolMenux.selectedIndex].value;

but that doesn't return anythin.

If for example i pass the document.myform.jmolMenux as
a variable to the new function, wheter in Jmol.js or in
the html page if I try to return the typeof that
variable, it says its an object, but If i try to read
the variable itself it says its am [object]

PLz need advice form someone with javascript experience.

It makes the same effect if I pass two variables with
the form and the select jmolMenu

Discussion

  • Nobody/Anonymous

    Logged In: NO

    hi,

    it has been a while, but I think you need to do this with a loop. something
    like this:

    for (var i=0; i<document.myform.jmolMenux.options.length; i++) {
    if (document.myform.jmolMenux.options.selected) {
    value = document.myform.jmolMenux.options[i].value;
    break;
    }
    }

    hth,

    tim d

     
  • Einar Coutin

    Einar Coutin - 2006-03-23

    Excerpt form the problem site(html and js)

     
  • Nobody/Anonymous

    Logged In: NO

    hi Einar,

    I am not familiar with Jmol.js, so I can't be of much help here. (I could tell you
    how to do it without Jmol.js, but that may not be useful for you.)

    I suggest that you post your question directly to the Jmol-users list; a lot of
    folks do use Jmol.js and you will probably find your answer quickly.

    best,

    tim d.

     
  • Einar Coutin

    Einar Coutin - 2006-03-24

    Logged In: YES
    user_id=1475990

    Hey thats great news... If you do know how to do it please
    post it, it doesn't matter if is not using the Jmol.js
    script file.
    Plese next time log in so I can directly email you. I know
    the system has some missinterfaced linking but you can clik
    in the lower parts of the email to get automatically logged in.

     
  • Nicolas

    Nicolas - 2006-03-31
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks