我有一个错误,阻止我的整个网站显示。所有的东西都加载了,我甚至可以悬停锚标签,但是整个页面都是白色的。
控制台中显示以下错误(仅在IE中):
SCRIPT1046: Multiple definitions of a property not allowed in strict mode
它指的是我的脚本,它会产生输入效果(更改字符串并将其动画化,就像有人在键入单词一样)。当我注释掉我的脚本时,网站就会显示为正常。
我的剧本:
try {
var firstSentence = $("#typed").attr('data-typed-first');
var secondSentence = $("#typed").attr('data-typed-second');
var thirdSentence = $("#typed").attr('data-typed-third');
var fourthSentence = $("#typed").attr('data-typed-fourth');
$("#typed").typed({
strings: [firstSentence, secondSentence, thirdSentence, fourthSentence],
typeSpeed: 0,
loop: true,
typeSpeed: 150
});
} catch(err) {
}我不知道这个错误意味着什么,所有的vars都有不同的名称,所以不是它。是什么导致了错误?
发布于 2017-05-18 14:01:19
typeSpeed出现了两次。
try {
var firstSentence = $("#typed").attr('data-typed-first');
var secondSentence = $("#typed").attr('data-typed-second');
var thirdSentence = $("#typed").attr('data-typed-third');
var fourthSentence = $("#typed").attr('data-typed-fourth');
$("#typed").typed({
strings: [firstSentence, secondSentence, thirdSentence, fourthSentence],
**typeSpeed: 0,**
loop: true,
**typeSpeed: 150**
});
} catch(err) {
}https://stackoverflow.com/questions/44049806
复制相似问题