Dear all,

In the page I am working on  I create a button to load new files as below:

<input TYPE="button" NAME="load_structure" class='button' value="Load file 
*.out/*out.gz"
       OnClick='jmolScript("load ?; script scripts/name.spt;  background 
white") + removeAllModels() + loadModels()'>

function loadModels() is expected to load on an external list all the models  
called within the first JmolScript(load ? .... ).  loadModels() just reads 
models from the previous structure and not from the  latest.
Do you know how to solve his problem? Does exist a way to let the javascript be 
executed sequentially as they are written? for instance  jmolScript("load ?; 
script scripts/name.spt;  background white") + removeAllModels() + loadModels() 
. Stick to the sequence ....

Thanks a lot, Piero
Function loadModels() is

function loadModels(selectbox){
            var Info = jmolGetPropertyAsArray("auxiliaryInfo.models")
         if(!Info){
             alert("No models available")
      return
              }
     for(var i=0; i< Info.length; i++)
      addOption(document.modelsVib.models, i + " " + Info[i].name, i + 2);
      }

function addOption(selectbox,text,value)
      {
      var optn = document.createElement("OPTION");
      optn.text = text;
      optn.value = value;
      selectbox.options.add(optn);
     }

thanks, Piero

--
Pieremanuele Canepa
Room 104
Functional Material Group
School of Physical Sciences, Ingram Building,
University of Kent, Canterbury, Kent,
CT2 7NH
United Kingdom

e-mail: [email protected]
mobile: +44 (0) 7772-9756456
-----------------------------------------------------------
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to