Sometimes when loading JSmol (from Jmol-14.6.0) I get the error below (approx. 1/4 times). Usually refreshing the page gets rid of it. It seems to only happen on pages that I use jquery on. I've tried jquery 1.9.1, 1.10.2, 1.11.0, and 1.12.2 and the version makes no difference. I've only tried on firefox so far. Do you know what I can do to fix this?
TypeError: Clazz.innerFunctions is undefined loading file /jsmol/j2s/java/util/Random.js java.util.Random
0 function (c,d,g,j,l)
1 function (a)
2 function (c,g)
3 function (c,d,e,g)
4 function (c,d,g,j,l)
5 function (a)
6 function (c,g)
7 function (c,d,e,g)
8 function (c,d,g,j,l)
9 function (a)
10 function (c,g)
11 function (c,d,e,g)
12 function (c,d,g,j,l)
13 function (a)
14 function (c,g)
15 function (c,d,e,g)
16 function (c,d,g,j,l)
17 function (a)
18 function (c,g)
19 function (c,d,e,g)
20 function (c,d,g,j,l)
21 function (a)
22 function (c,g)
23 function (c,d,e,g)
24 function (c,d,g,j,l)
Moving the Jmol initialization into window.onload instead of $(document).ready(function() seems to have fixed it. I haven't had the error come back so far.
That is not an adequate solution. The applet must be able to be defined in $(document).ready. The only calls to Clazz.innerFunctions are in .js files that are never supposed to be loaded, namely java.lang.number.js, java.lang.string.js, java.lang.class.js, java.lang.classext.js. These are all classes that are already part of j2sjmol.js, which is included in corejmol.js.
So if any of these classes are being loaded, it would appear that corejmol.js is not being loaded. Could I see what the code is in your $(document).ready function?
What I could do is move the definition of java.util.Random in the file up
ahead of java.util.AbstractCollection, which is requiring it.
On Fri, May 27, 2016 at 7:12 PM, Bob Hanson hansonr@users.sf.net wrote:
--
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
Related
Bugs: #581
I just upgraded to jmol-14.6.0_2016.06.22 and I don't get this error anymore when initalizing from JSmol from $(document).ready(function()