getMol() doesn't works with chrome

User 247a2c5018

02-04-2012 10:00:19


Dear support,


I test the function getMol()  with Chrome but it doesn't work : 

s1 = msketch.getMol("mol");


With Firefox and IE, it works


Do you have any solution?

ChemAxon 5433b8e56b

02-04-2012 14:58:38

Hi,


can you check that whether the export button on this page works for you or not? It also uses the getMol() method on the applet and place the molecule spource to the textarea above the applet.


Regards,
Istvan

User 247a2c5018

02-04-2012 15:27:26

The button export doesn't work but the import button works.

ChemAxon 5433b8e56b

02-04-2012 15:30:44

Can you see any error on the java console?


And also can you tell me which Java version, which Chrome version, and which applet version do you use on which operating system?

User 247a2c5018

02-04-2012 16:01:25









MarvinSketch 5.2.3_1


java 6 update 31


no error in the java console


User 247a2c5018

02-04-2012 16:01:58

chrome : 18.0.1025.142 m

User 247a2c5018

03-04-2012 07:25:05

The export button works with chrome; I forget to draw a structure

ChemAxon 5433b8e56b

06-04-2012 10:53:44

Hi,


I have checked the 5.2.3_01 version of Marvin applets, with Chrome, i could reproduce a javascript problem, with our example i have asked from you to check in the current version.


I found that with 5.2.3 the document.MSketch referencing to the applet is not working somehow it refers to null, and therefore the document.MSketch.getMol() method call fails. Please try to use document.getElementById(msketch_name).getMol() instead, and check what happens. For me it has worked under Chrome.


Regards,
Istvan

User 247a2c5018

06-04-2012 12:45:33

What must I enter for msketch_name?

ChemAxon 5433b8e56b

09-04-2012 02:07:38

If you use custom html tag for applet embedding, then you must enter the id property of the <embed> <applet> or <object> tag.
If you use marvin.js, then it is a defined variable in the marvin.js file that defaults to empty string, and if you want to access the applet from Javascript, in the way our examples show, it is mandatory to be set. If you set it you can simply use the variable in the example code, if you haven't set it before, then that could be also the cause of your issue. (Our examples set it to "MSketch" when the example show javascript functionalities, but its value can be any string)


Regards,
Istvan

User 247a2c5018

18-04-2012 14:00:33

I try : var molfile = document.getElementById("MSketch").getMol("mol");


 


I have the same problem; works with Firefox not with Chrome

ChemAxon 5433b8e56b

26-04-2012 12:53:53

Hi,


first of all sorry for the late silence on this, I have missed your answer and just noticed it.


I have retested the 5.2.3_1 version with my chrome browser.


I have a Win 7 64 bit environment, with 32 bit 1.6.0_u31 java, and the same 32 bit chrome version.


I use the following code for testing:


<html>
<head>
<title>Test Chrome and getMol()</title>
</head>
<body onload="alert('onLoad:'+document.getElementById('MSketch').getMol('mol'));">
<script type="text/javascript" language="javascript1.1" src="marvin/marvin.js"></script>
<h2>Test new marvin.js</h2>
<div>
<script type="text/javascript" language="JavaScript1.1">
//<!--
msketch_name="MSketch";
msketch_begin("marvin", 400, 400);
msketch_param("mol", "CC=CC=CC");
msketch_end();
alert('inSameScript:'+document.getElementById('MSketch').getMol('mrv'));
//-->
</script>
</div>
<button onClick="alert('onClick:'+document.getElementById('MSketch').getMol('mrv'));">getMoleculeInAlert</button>
<script type="text/javascript" language="JavaScript1.1">
alert('inOtherScript:'+document.getElementById('MSketch').getMol('mrv'));
</script>
</body>
</html>

One of the four attempt is working. The alert in the onClick handler of the button is working in chrome, that is the only one that works in Internet Explorer 9 also. In Firefox 12.0 all for method works.


Actually this can be because of some paralel program execution related variable value visibility problem inside the javascript and java communication in the browser. But I have found that the code with newer versions of Marvin works only in the onClick event handler also.


I am going to check this functionality with a very basic applet, and try to figure out whether it is a Marvin or a browser bug, but for the first sight i would say it is a browser issue, since the applet object is not null, but its methods are unavailable for the javascript code at the points where it is not working.


I will get beck to you with the results as soon as i can, but i have a lot of things to do until our 5.10 commit deadline and the time is short until that, so it may take some days to find the time to check this.


Regards,
Istvan

ChemAxon 5433b8e56b

04-06-2012 11:31:13

Hi,


I have news on this issues, but not really good ones.


I hope you could workaround the problem. We decided to investigate this issues in applet initialization, and we try to find out why the methods are unavailable in certain situations. The decision was made because when we tried this with a simple applet, it turned out that the simple applet works in every situation not as the Marvin applets.


Sorry for the inconvenience, and thank you for your patience on this, if we have further information on this, we will post it into this topic also.


Regards,
Istvan

ChemAxon 5433b8e56b

06-07-2012 11:35:10

Hi,


we started to investigate this issue, to be able to release a fix in 5.10.1 which is going to be released soon, and found that the issue is not reproducable with the 5.10.0 release of Marvin applets.


There is only one limitation with the final build, you can not call the applet from the same script tag where it has been created with the help of marvin.js.


We tried this with the latest Firefox, Chrome, and IE browsers with 1.6 and 1.7 java.


Do you still have the problem with the latest marvin version (currently the 5.10)?


Regards,
Istvan

User 247a2c5018

06-07-2012 12:21:33

No i don't try with the latest version of Marvin 5.10.0 yet.


I will wait for the last release.


Have you seen the same problem with safari?

ChemAxon 5433b8e56b

16-07-2012 12:59:19

Hi,


Sorry for the late answer, I have overlooked you question unfortunatelly, No I haven't tried it with Safari, since it is not supported by Marvin on Windows, or do you mean a test on MacOSX?


After testing the applets on MacOSX i can tell that, the same limitation exsits there, so you can not call methods of the applet from the same script tag where the applet is being created, otherwise 5.10.0 is working.


Regards,
Istvan

User 247a2c5018

16-07-2012 14:14:46

I download the file  marvin-all-5.10.0.tar.gz and run tar zxvf marvin-all-5.10.0.tar.gz to obtain the directory marvin


When I try to launch the applet, i have this error :


 


 Java Plug-in 1.6.0_31


Utilisation de la version JRE 1.6.0_31-b05 Java HotSpot(TM) Client VM


Répertoire d'accueil de l'utilisateur = C:\Users\Kiet


----------------------------------------------------


c:   effacer la fenêtre de la console


f:   finaliser les objets de la file d'attente de finalisation


g:   libérer la mémoire


h:   afficher ce message d'aide


l:   vider la liste des chargeurs de classes


m:   imprimer le relevé d'utilisation de la mémoire


o:   déclencher la consignation


q:   masquer la console


r:   recharger la configuration des politiques


s:   vider les propriétés système et déploiement


t:   vider la liste des threads


v:   vider la pile des threads


x:   effacer le cache de chargeurs de classes


0-5: fixer le niveau de traçage à <n>


----------------------------------------------------


charger : classe JMSketchLaunch introuvable.


java.lang.ClassNotFoundException: JMSketchLaunch


at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)


at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)


at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)


at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)


at java.lang.ClassLoader.loadClass(Unknown Source)


at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)


at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)


at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)


at java.lang.Thread.run(Unknown Source)


Exception : java.lang.ClassNotFoundException: JMSketchLaunch


 


 


In my php code, to call the applet : 


 


<applet CODEBASE="marvin/" ARCHIVE="appletlaunch.jar" CODE="JMSketchLaunch" name="MSketch" WIDTH=360 HEIGHT=380>

ChemAxon 5433b8e56b

16-07-2012 14:20:37

Can you please try to clean the java cache?

User 247a2c5018

16-07-2012 14:34:17

Ok i clean the java cache but still the same problem


When i try with the old marvin 5.2.3.1, the applet starts correctly

ChemAxon 5433b8e56b

16-07-2012 14:39:11

Oh, sorry, I have overlooked the CODE property of the give applet tag. In 5.3 and above versions, the applet classes have been moved to chemaxon.marvin.applet package, so the correct value for the CODE property is "chemaxon/marvin/applet/JMSketchLaunch".

User 247a2c5018

16-07-2012 14:51:27

Ok the applets works but still the same problem with chrome...by using MarvinSketch 5.10.0





ChemAxon 5433b8e56b

16-07-2012 15:39:16

I have tried it again, and it is working for me.


But I have noticed somthing again.


You set the name property of the applet tag in the example below not the id property. So maybe the issue lies here, can you please try to either change the name="MSketch" to id="MSketch" or just simply add id="Msketch" to the applet tag?

User 247a2c5018

17-07-2012 09:31:10

I try to replace name by id but still the same problem with chrome


 


I try with these 2 examples : 


 



var molfile = document.MSketch.getMol("mol");


or 


var molfile = document.getElementById("MSketch").getMol("mol");


 


but same problem


ChemAxon 5433b8e56b

23-07-2012 20:55:38

Hi,


I am completely lost and stucked here, I tried to reproduce this with latest Chorme, with latest and older Java versions, but I was not able to reproduce the issue.


Can you send me - even in private in a mail, if it is considered confidential - the whole html page, or the whole code that generates the html page that you have problems with?


Istvan

ChemAxon 5433b8e56b

24-07-2012 12:51:32

Hi,


thank you for the source code, I have got it. It seems there is still the same problem with the applet tag.


My proposed change was to replace the name property to the id property in the applet tag, as shown here:


<applet CODEBASE="marvin/" ARCHIVE="appletlaunch.jar" CODE="chemaxon/marvin/applet/JMSketchLaunch" idname="MSketch" WIDTH=360 HEIGHT=380>


This is what you have tried?


Regards,
Istvan

User 247a2c5018

24-07-2012 13:01:29

Yes I already tried your proposal.


I retry today and the problem is still the same with Chrome

ChemAxon 5433b8e56b

24-07-2012 13:44:36

Ok, I have got it.


It seems the problem lies in the events and elements you are using in the form.


You have a form element that validates when the onSubmit event happens, and have two submit type input element, each of them calls a submit() on the form, but the validation sets the molecule source into the hidden input fields.


I assume the validation does not happen, because the form is submitted when the click event of the submit element happens.


Modify your form to not have an onSubmit event handler, put the validation method call into the click event of the current submit type elements, and change the submit type elements to be simply button type elements, and it should work either if there is a name property or an id property inside the applet tag. When there is a name property, then the getElementByID call may not work.


I am sending the modifications I have made in a mail for you.


Regards,
Istvan

User 247a2c5018

24-07-2012 14:14:58

Thanks it's works with Chrome even with Marvin 5.2.3


Strange it worked with IE and Firefox...

ChemAxon 5433b8e56b

25-07-2012 09:37:19

I only have guesses about what could happen in the background, but I am glad that the problem is solved.


Regards,
Istvan