|
From: Jochen J. <joc...@fi...> - 2025-06-01 19:49:38
|
I have spotted a difference in the AppletHTML code that Jmol generates for embedding: V14 -> <canvas style="width: 100%; height: 100%;" width="385" height="364" id="jmolc_canvas2d"></canvas> V16 -> <canvas tabindex="1" style="width: 100%; height: 100%; z-index: 9002;" width="0" height="0" id="jmolc_canvas2d"></canvas> Maybe that serves as a clue? Jochen On 1 Jun 2025, at 03:33, Robert Hanson via Jmol-users <jmo...@li...> wrote: General methods to solve Jmol loading problems: 0. Try a different browser. Sometimes one is ahead of another in JavaScript, and there is some change there. 1. Use URL option ?j2sdebugcode ? can be & or # as needed if you already have query fields in the URL. This bypasses all core package loading and will allow finding the specific place in the code where the problem occurs. Loading will be slower, but the error report should be much clearer. 2. Open the browser developer console debugger or source tab and click stop on errors, including caught errors The page always throws and catches a few errors as it loads in order to check the browser for comparability issues. So push through those until the error you are seeing is thrown. There is also at least one error that does not generally affect loading that should not be there but I have not worried about it. Maybe you can tell me how to get around that. Anyway, continue until your error is thrown and follow the stack trace to guss out what is happening where. It may be important if you are loading multiple instances to sequence them rather than to get them all going simultaneously. The loading process is asynchronous and especially with legacy Jmol quite complex. Lots of timeouts and lots of queued tasks. Though JavaScript is a single thread, these asynchronous processes need to proceed in a certain order. IndexSizeError: Index or size is negative or greater than the allowed amount This error is interesting because I think it is new. I have not seen it before, at least stated as such. Traditionally JavaScript does not throw array out of bounds exceptions except for negative numbers. Probably a counter went negative. 3. Another option is to use the _J2S option. The value of that should be the full path to a j2s directory on another path or domain. This allows direct comparison between two versions on the same or different machines. 4. At this point if I am still not seeing the exact problem I start setting debugging break points, reloading the page to see what is going on at some particular point. This invariably at least identifies the problem. 5. Worst case process is to run two versions side by side with break points in the same place looking for differences. This ultimately discovers the issue. It's a huge help to have one working version. This is a famous truck and one that I use regularly on the Java side. I always start with the SwingJS code and then power that to the legacy only when it is working in SwingJS. 6. Be patient and confident that whatever the problem is, it is most likely something very simple. 7. Send us a link to the failing page. Several people reading this can give it a try. Only do the above if you are interested in the challenge. Bob _______________________________________________ Jmol-users mailing list Jmo...@li... https://lists.sourceforge.net/lists/listinfo/jmol-users |