partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
247 stars 61 forks source link

Error in Internet Explorer #270

Open sudoduan opened 2 years ago

sudoduan commented 2 years ago

Has anyone successfully run Kekule.js in Internet Explorer? We got "Kekule undefined" error in our project. The same project works fine in Chrome and Firefox.

partridgejiang commented 2 years ago

Hi @sudoduan, since Internet Explorer is a so ancient and has been abandoned by MS for a long time, we do not run tests on IE anymore currently. Anyway, some usages of new JavaScript syntax can not be recognized by IE has now been fixed. Please check and clone the newly committed code.

Please note that the webComponent module is totally unsupported in any versions of IE. So when using the library, please do not include it when loading script by kekule.js. For example, the following HTML code will surely cause loading errors in IE:

<script src="pathToKekule/kekule.js?modules=chemWidget,webComponent></script>

As for the all-in-one kekule.min.js, it contains all available modules (including webComponent) and can not be parsed or loaded in IE directly. To workaround this problem, you may need to compress a custom one by yourself. Please check the compress tool in utils/jsMinifier directory and run the js minifier with the following command line to generate kekule.min.js without webComponennt module:

node run.js -e webComponent -d destinationDirectory

Such a custom min file is attached here and you may use it directly.

kekule.min.zip

sudoduan commented 2 years ago

@partridgejiang Thank you! I will try it out.