JQuery $ .fn在Internet Explorer 11上不起作用

问题描述 投票:0回答:1

我正在为RTF编辑器开发包装器插件。一切都可以在Chrome上运行,但是我需要它才能在Internet Explorer 11上运行。页面加载后,会弹出一个错误(Object doesn't support property or method 'editor')。 JQuery文档说IE应该支持($.fn),所以我对问题所在感到困惑。我需要填充一些东西吗?

editor.js

import { ImageDrop } from "./image-drop.js";

$.fn.editor = function (options) {
  const REQUIRED = typeof(options.required) != "undefined"
    ? options.required
    : true;

// the rest of the plugin goes here
});

index.html

<div id="editor"></div>

<script type="module" src="./image-drop.js"></script>
<script type="module" src="./editor.js"></script>

<script type="text/javascript">
  $(document).ready(function () {
    $("#editor").editor({
      required: true;
    });
  });
</script>

javascript jquery internet-explorer-11
1个回答
0
投票

通过反复试验发现了问题所在。 IE11不支持模块,因此无法运行<script type="module">

© www.soinside.com 2019 - 2024. All rights reserved.