IE Browser Crashes when loading Marvin Applet.

User 7fe7cbcd5f

05-12-2005 17:31:23

We have a strange (and replicable) error on our website that is IE specific. I cannot replicate on Safari, Netscape, nor Mozilla. When IE loads our webpage, if you type in a text box prior to the Marvin applet completing its load process, the IE window throws a severe error and crashes. The first time the page loads, the applet take a few seconds to load so it's easy to crash the browser. After that it loads much quicker and is more difficult to replicate because it's in memory.





The error IE throws is pretty non-descriptive as follows:


AppName: iexplore.exe AppVer: 6.0.2900.2180 ModName: mshtmled.dll


ModVer: 6.0.2900.2753 Offset: 00045331





We use pretty standard syntax to render the applet like this:





<script LANGUAGE="JavaScript1.1" SRC="js/marvin.js"></script>


<script LANGUAGE="JavaScript1.1">


<!-- mview_mayscript = true;


msketch_name = "MSketch";


msketch_begin("http://hostname/applet/", 180, 180);


msketch_param("preload", "MolExport,SmilesExport, GraphInvariants, Parity");


msketch_param("bgcolor", "#F7F7F7");


msketch_param("molbg", "#F0F0F0");


msketch_param("dispopts", "implicitH=off");


msketch_param("queryatoms", "any,hetero,list,notlist");


msketch_param("extrabonds", "arom,any,1or2,wedge, either,ctu");


msketch_param("undo", "50");


msketch_param("detach", "hide");


msketch_end();


//-->


</script>





Has anyone encountered this issue before? Any tips on resolving are welcome. Thanks in advance.

ChemAxon 7c2d26e5cf

06-12-2005 13:16:35

It seems to be a bug in the focus handling of IE. I suggest the following workaround:


Set your text box to disabled when the page is loaded then set it to enabled after the applet is started. To do this, you have to use the "molLoaderFinishedEvent" applet parameter in the MarvinSketch.
Quote:



<head>


<script language="JavaScript1.1">


<!--


function disableInput() {


document.inform.txtbox.disabled = true;


}





function enableInput() {


document.inform.txtbox.value = "ENABLED";


}


//-->


</script>


</head>


<body>


<form name="inform">


<input type="textarea" row="4" cols="20" name="txtbox">


</form>


<script LANGUAGE="JavaScript1.1" SRC="http://www.chemaxon.com/marvin/marvin.js"></script>


<script LANGUAGE="JavaScript1.1">


<!--


disableInput();





mview_mayscript = true;


msketch_name = "MSketch";


msketch_begin("http://www.chemaxon.com/marvin", 180, 180);


msketch_param("preload", "MolExport,SmilesExport, GraphInvariants, Parity");


msketch_param("bgcolor", "#F7F7F7");


msketch_param("molbg", "#F0F0F0");


msketch_param("dispopts", "implicitH=off");


msketch_param("queryatoms", "any,hetero,list,notlist");


msketch_param("extrabonds", "arom,any,1or2,wedge, either,ctu");


msketch_param("undo", "50");


msketch_param("detach", "hide");


msketch_param("mol","empty.mol");


msketch_param("molLoaderFinishedEvent","js:enableInput()");


msketch_end();


</script>


User 7fe7cbcd5f

08-12-2005 16:40:23

Tamas,





Thank you, the workaround fixed the IE issue.





Greg