self[param1.split("_")[0]]

will be, for instance, jmolAppelt0


On Sun, Oct 6, 2013 at 11:18 AM, Angel HerrŠez <angel.herraez@uah.es> wrote:
I cannot find documentation on the callbacks in JSmol

My problem is how to apply a script in the callback function
I have

Info = {
† loadstructcallback: 'modelLoaded';
}

function modelLoaded(a,b,c) {
† Jmol.script( myJmol, myScript );
}

The question is how to provide myJmol object reference for the script. As far
as I can see, the first parameter returned from the callback is a text string in
the way †myJmol_object
But I need the Jmol object itself, not a text string.

I found that this works, but I'd rather not use an internal objectref.:
Jmol.script( Jmol._applets[a.split("_object")[0]], myScript )

I think there must be a user-friendly way of referring to the †Jmol Object
returned from the callback. Old jmolCallback() returned a text string (the
applet id) but that could be used directly, since the applet id is what the
Jmol.js functions expected.

So what's the way?
Thanks


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users



--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900