From: Gareth O. <go...@gp...> - 2013-08-20 05:12:21
|
Hi there, I'm not sure if this is the correction mailing list or not, but wanted to report an issue with JSmol. We are working on integrating JSmol into a web site which already uses MathJax and we ran into an incompatibility issue. We have a crude workaround but I wanted to explore the root cause. I have discovered that upon execution of the JSmol getApplet() method, the java2script Clazz system seems to replace the standard Javascript Error object with a copy of java.lang.Error. This causes MathJax to fail because it expects to have the standard Javascript Error object available. Why are objects in the global Javascript namespace being modified and is there a way to prevent it? BTW I discovered this in test file "jsmol.htm" which ships with jsmol-13.3.3.zip. My test environment was Chrome 28.0.1500.95 on Windows XP. Cheers, Gareth Oakes |
From: Geoffrey R. <row...@gm...> - 2013-08-20 09:52:20
|
Have not investigated this in any detail, but have also noticed a clash between JSmol and MathJax in some circumstances - with MathJax displaying a [Math Processing Error]. In case it helps with the diagnosis, here are the symptoms I have observed. Behaviour is somewhat variable. Firefox appears least susceptible, Chrome and IE more so. Sometimes a page reload fixes the issue, sometimes it breaks a working display. The problem appears worse for pages with more, or more complex, JSmol instances. So, perhaps related to the relative load/processing times for JSmol and MathJax? Get the problem whether MathJax is loaded locally or from CDN. Cheers Geoff |
From: Robert H. <ha...@st...> - 2013-08-20 14:31:54
|
[you must be working with Gareth, right?] So what is MathJax, and what does it have to do with Jmol? Sounds interesting.... There are some general browser page-reloading issues with JavaScript in general. I think it can depend upon whether you press ENTER in the URL line or press whatever button does a reload. Looks to me like it handles memory differently. Not sure. Bob On Tue, Aug 20, 2013 at 4:52 AM, Geoffrey Rowland <row...@gm...>wrote: > Have not investigated this in any detail, but have also noticed a clash > between JSmol and MathJax in some circumstances - with MathJax displaying a > [Math Processing Error]. > > In case it helps with the diagnosis, here are the symptoms I have > observed. Behaviour is somewhat variable. Firefox appears least > susceptible, Chrome and IE more so. Sometimes a page reload fixes the > issue, sometimes it breaks a working display. The problem appears worse for > pages with more, or more complex, JSmol instances. So, perhaps related to > the relative load/processing times for JSmol and MathJax? Get the problem > whether MathJax is loaded locally or from CDN. > > Cheers > > Geoff > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Jmol-developers mailing list > Jmo...@li... > https://lists.sourceforge.net/lists/listinfo/jmol-developers > > -- 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 |
From: Robert H. <ha...@st...> - 2013-08-20 14:28:45
|
Gareth, Right list for sure. Yes, that's an important issue. I'm not satisfied, either, for just this reason. It's not an easy one, because it relates to the Java2Script compiler we use. There are many extensions we do need to use - especially in the number area. Not sure about JavaScript error processing, although obviously we need to catch those for our own purposes. If you point me to a problem page and point me to the bit of your MathJax code that is problematic, I can see what I can do. Bob On Tue, Aug 20, 2013 at 12:12 AM, Gareth Oakes <go...@gp...>wrote: > Hi there, > > I'm not sure if this is the correction mailing list or not, but wanted to > report an issue with JSmol. We are working on integrating JSmol into a web > site which already uses MathJax and we ran into an incompatibility issue. > We have a crude workaround but I wanted to explore the root cause. > > I have discovered that upon execution of the JSmol getApplet() method, the > java2script Clazz system seems to replace the standard Javascript Error > object with a copy of java.lang.Error. This causes MathJax to fail because > it expects to have the standard Javascript Error object available. > > Why are objects in the global Javascript namespace being modified and is > there a way to prevent it? > > BTW I discovered this in test file "jsmol.htm" which ships with jsmol-13.3.3.zip. > My test environment was Chrome 28.0.1500.95 on Windows XP. > > Cheers, > Gareth Oakes > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Jmol-developers mailing list > Jmo...@li... > https://lists.sourceforge.net/lists/listinfo/jmol-developers > > -- 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 |
From: Robert H. <ha...@st...> - 2013-08-20 16:27:23
|
It's a pretty simple solution. Really what the problem is is that both Jmol and MathJax are competing for the AJAX processing. For compatibility with MathJax, make sure: 1) you are using dynamic loading of the applet -- no <script> tags that use Jmol.getApplet() within the body -- use $(document).ready() to create all applets 2) then set the jQuery document ready event to monitor MathJax loading and only start in on the AJAX until that is done. For example: $(document).ready(function(){ loadJmol(); }); loadJmol = function() { if (!$("#MathJax_Message")[0] || $('#MathJax_Message:contains("Loading")')[0]) { setTimeout(loadJmol, 10); return; } Jmol.setDocument(0); Info.deferApplet = false; Info.deferUncover = true; jmol1 = Jmol.getApplet("jmol1", Info) $("#appletplace1").html(Jmol.getAppletHtml(jmol1)); Info.deferApplet = true; Info.deferUncover = true; jmol2 = Jmol.getApplet("jmol2", Info) $("#appletplace2").html(Jmol.getAppletHtml(jmol2)); } On Tue, Aug 20, 2013 at 12:12 AM, Gareth Oakes <go...@gp...>wrote: > Hi there, > > I'm not sure if this is the correction mailing list or not, but wanted to > report an issue with JSmol. We are working on integrating JSmol into a web > site which already uses MathJax and we ran into an incompatibility issue. > We have a crude workaround but I wanted to explore the root cause. > > I have discovered that upon execution of the JSmol getApplet() method, the > java2script Clazz system seems to replace the standard Javascript Error > object with a copy of java.lang.Error. This causes MathJax to fail because > it expects to have the standard Javascript Error object available. > > Why are objects in the global Javascript namespace being modified and is > there a way to prevent it? > > BTW I discovered this in test file "jsmol.htm" which ships with jsmol-13.3.3.zip. > My test environment was Chrome 28.0.1500.95 on Windows XP. > > Cheers, > Gareth Oakes > > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Jmol-developers mailing list > Jmo...@li... > https://lists.sourceforge.net/lists/listinfo/jmol-developers > > -- 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 |