简体   繁体   English

IE(Internet Explorer)的QUnit测试错误

[英]QUnit test error with IE (Internet Explorer)

Hy i wrote some QUnit test's for an old JS-File (an specific Date-calculation-JS). Hy我为旧的JS文件(特定的Date-calculation-JS)编写了一些QUnit测试。

Question: 题:

It works very well on Firefox and Chrome but i got this Error on IE : 它在Firefox和Chrome上效果很好,但是我在IE上收到此错误

Died on test #1 undefined: Der Wert der Eigenschaft "jQuery" ist Null
oder undefiniert, kein Function-Objekt

and on IE8: 在IE8上:

Died on test #1 undefined: Object expected

Specs: 眼镜:

You can take a look at my Javascript Code . 您可以看一下我的Javascript代码
I used this minimal QUnit HTML pattern. 我使用了这种最小的QUnit HTML模式。
JQuery version: 2.1.3 jQuery版本:2.1.3
QUnit version: 1.17.1 QUnit版本:1.17.1

At first, i tried to change "$" with "jQuery", but this error still exists. 起初,我尝试使用“ jQuery”更改“ $”,但此错误仍然存​​在。

In my case, i solved this issue for IE >= 9 by adding the following meta-Tag. 就我而言,我通过添加以下meta-Tag解决了IE> = 9的问题。

<meta http-equiv="X-UA-Compatible" content="IE=edge">

IE8 won't work with jQuery version 2.xx IE8无法与jQuery 2.xx版一起使用
You only have to change your JQuery-Version, eg to 'jquery-1.11.2.min.js'. 您只需要将您的JQuery-Version更改为例如“ jquery-1.11.2.min.js”。

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

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