I am trying to load the jmol applet when click the button, I have tried the following function
<script>
var xax = new jmolInitialize("jsmol");
function myfunction(cc) {
console.log("CC is", cc);
window.a = 'TYR';
window.b = '613';
window.c = 'A';
window.d = 'ADE'; window.e = '902'; window.f = 'A'; window.average_a = '33.409 26.811 6.327'; window.average_b = '32.137 23.485 4.709';
jmolApplet(450, `load static/1z8d.pdb; background [0,0,0]; display [${a}]${b}:${c},[${d}]${e}:${f}; delay 1;zoom 400; color echo white; set echo top left; echo 1Z8D;measure {${average_a}}{${average_b}};set measurement angstroms;`, "0");
}
// myfunction("ddd"); it is working
</script>
If I call the method directly after initializing it is working fine. But if I call the method onbutton click this method is not jmolapplet is not loading.
I am not sure, what is the problem here.