boolean value of applet.getMol

User 870ab5b546

13-06-2014 01:48:20

Hi,


For years we have had the following lines of code:


			var applet = document.responseApplet; 
if (!applet || !applet.getMol) {
toAlert('Your browser does not support the LiveConnect feature. Please read the documentation regarding browser requirements.');
return;
} else if (applet.isEmpty()) {
toAlert('ACE could not acquire your response to this question. Please submit a response that is not empty.');
return;
} // if response is empty

Four students, all PC users using Internet Explorer 11, have now reported that they get the error message about their browser not supporting the LiveConnect feature, even though they have done a browser checkup that shows that their browser does indeed support LiveConnect. (They get the correct value for applet.getMol().) So I set up the following test code:


            alert('boolean value of document.ans_applet.getMol is '

                    + (document.ans_applet.getMol ? 'true' : 'false'));


My browser (Safari 7 on MacOS Maverick) returns, "Boolean value of document.ans_applet.getMol is true," but for at least one of the PC-using students, his browser returns, "Boolean value of document.ans_applet.getMol is false." 


I should also mention that two of the students reported that switching to Chrome solved the problem, but for two other students, it did not.


Any idea what is going on here? Is there a Java or browser security setting that is preventing it from getting a value of true for applet.getMol?

ChemAxon 4fa3cf533c

13-06-2014 12:50:54

Hi there,


I reproduced your scenario, and even I got the same result in IE 11, but in my case I was unable to reproduce it in Chrome, nor any other browsers.


I think this issue is only comes with IE 11, and possibly lower versions, where the applet functions are "undefined", whereas they do exist, they are callable, and properly working.


I found a similar issue at stackoverflow where the user tests the applet function in an if statement. If it comes back as "undefined" the expression will be false, since the boolean value of undefined is false. 


I suggest checking the return value of the function would be a solution. For example, if the applet is started, and you call applet.getMol("mrv"), then it should return a non empty string, if it is working properly.


Regards,


Tamas Fazekas-Vígh