简单展开(JQuery)不适用于InternetExplorer11,但适用于其他浏览器

Simple-Expand (JQuery) not working in Internet Explorer 11 but works in other browsers

本文关键字:适用于 InternetExplorer11 其他 浏览器 不适用 JQuery 简单      更新时间:2023-09-26

我在Windows盒子上运行XAMPP。下面是我的测试文件:

<html>
<head>
<title>very nice file</title>
</head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<body>
<a class="expander" href="#">click me</a>
<div class="content">
    I WANT TO HIDE THISSSS.
</div>
</body>
</html>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="https://raw.githubusercontent.com/redhotsly/simple-expand/master/src/simple-expand.js"></script>
    <script type="text/javascript" language="javascript">
    $(document).ready(function() {
           $('.expander').simpleexpand();
           });
    </script>

当我在Internet Explorer中浏览该文件时,我会看到"点击我"answers"我想隐藏THISSSS"。当我在其他浏览器中浏览时,我会看到"点击我",点击它会取消隐藏"我想隐藏THISSSS"文本。

搜索了一整夜,仍然一无所获!有什么想法吗?谢谢

你真的需要那个扩展器吗?如果你只是想隐藏/显示一个内容。您可以用几行代码创建一个,因为您使用的是jquery

你可以在这里试试这个简单的小提琴https://jsfiddle.net/yzdthzhL/

你可以播放你想要的代码。

顺便说一句。我不确定这是否有帮助,但是。将脚本添加到html文档中会很好。

<html>
<head>
  <script src="somelibrarieshere"></script>
</head>
<body>
<script src="somelibrarieshere"></script>
</body>
</html>

并且不在html块之外。这样更好。:)祝你度过美好的一天,伙计。