Maybe the culprit is earlier or later. I am setting "n" as a variable
in a function that calls jmolApplet. The following change solves the
problem but it is a bad kludge:
var n = 0;
var nquote = ""+n;
jmolApplet([width,height],scriptStr, nquote);
This makes a new jmolApplet0 to replace the one that was destroyed.
Using n directly creates a jmolAppletXX, where XX = _jmol.appletCount.
I had assumed the problem was this test. But your results suggest
not. Is there something earlier or later in the code that is also
checking the appletID? I hadn't noticed anything.
Jonathan
On Oct 13, 2010, at 5:21 AM, Angel Herráez wrote:
> Jonathan, I'm running this test (out of Jmol.js):
>
> var appletCount = 1;
> function test(a,b,nameSuffix) {
> nameSuffix == undefined && (nameSuffix = appletCount);
> alert(nameSuffix);
> }
> var x = 0;
> test(0,0,x); // returns zero
> x = "0";
> test(0,0,x); // returns zero
>
> So how are you setting the "n" variable?
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
> Spend less time writing and rewriting code and more time creating
> great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> Jmol-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
Dr. Jonathan H. Gutow
Chemistry Department [email protected]
UW-Oshkosh Office:920-424-1326
800 Algoma Boulevard FAX:920-424-2042
Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers