|
From: Mark P. <pe...@so...> - 2025-06-02 03:09:04
|
Hi Jochen,
Are you talking about jmolc? I can't find where it's created in your
source. But it's not getting loaded correctly: jmolc._applet is null.
If you do:
document.getElementById("jsmol_container").innerHTML="";
document.getElementById("jsmol_container").innerHTML=Jmol.getAppletHtml("jmolc",Info);
It will load.
The css is also display:none, but I'm not sure if that's because it's not
loaded correctly.
Thanks,
Mark
On Sun, Jun 1, 2025 at 11:58 AM Jochen Junker <joc...@fi...>
wrote:
>
> Hi Bob!
>
> Thank you and Angel for your input. I have had my share of cache related
> issues, so I can rule that out.
>
> 0. Try a different browser. Sometimes one is ahead of another in
> JavaScript, and there is some change there.
>
>
> I normally do my development on Firefox because of the Debugger. The same
> error happens on Safari and Chrome. On Chrome I got the most meaningful
> error message: “IndexSizeError: Failed to execute 'getImageData' on
> 'CanvasRenderingContext2D': The source width is 0."
>
> But, I do not get any errors on the console. On the console I see the
> normal messages that the applet was started.
>
> 1. Use URL option ?j2sdebugcode
>
>
> ? can be & or # as needed if you already have query fields in the URL.
>
>
> Unfortunately this does not work in this case.
>
> 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.
>
>
> In V14 I get the CORS error, but that is it.
> In V16 I get no significant errors from Jmol.
>
> 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.
>
>
> This error seems to be related to using clipping in canvas’ drawImage
> function:
>
> https://stackoverflow.com/questions/19338032/canvas-indexsizeerror-index-or-size-is-negative-or-greater-than-the-allowed-a
>
> 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.
>
>
> As suggested, I have set up 2 pages just differing in the Jmol version.
> Version 14 here: https://toratheu.de/compare14?cocon1720457998896
> Version 16 here: https://toratheu.de/compare16?cocon1720457998896
>
> This pages are on a development server. Opening the pages will give 2 XHR
> 404 errors, which are handled gracefully and do not relate to Jmol. Besides
> that the Debugger in Firefox does not give out any errors. To see the other
> instances of Jmol working on the Version 16 page you have to click the
> 3D/2D toggle in the results window (Title: Total of 28 Constitutions
> found). I have embedded the Jmol loading messages in an other window, makes
> it easier to follow.
>
> I have also managed to identify where the error happens, a screenshot of
> the location follows. Maybe that helps.
>
> Best Regards,
> Jochen
>
>
> [image: Screenshot 2025-06-01 at 15.54.10.png]
> _______________________________________________
> Jmol-users mailing list
> Jmo...@li...
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
|