繁体   English   中英

JQuery $.fn 不适用于 Internet Explorer 11

[英]JQuery $.fn not working on Internet Explorer 11

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

编辑器.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
});

索引.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>

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM