首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >由于脚本错误,internet explorer 11上的空白屏幕

由于脚本错误,internet explorer 11上的空白屏幕
EN

Stack Overflow用户
提问于 2017-05-18 13:57:21
回答 1查看 275关注 0票数 0

我有一个错误,阻止我的整个网站显示。所有的东西都加载了,我甚至可以悬停锚标签,但是整个页面都是白色的。

控制台中显示以下错误(仅在IE中):

SCRIPT1046: Multiple definitions of a property not allowed in strict mode

它指的是我的脚本,它会产生输入效果(更改字符串并将其动画化,就像有人在键入单词一样)。当我注释掉我的脚本时,网站就会显示为正常。

我的剧本:

代码语言:javascript
复制
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都有不同的名称,所以不是它。是什么导致了错误?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-18 14:01:19

typeSpeed出现了两次。

代码语言:javascript
复制
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) {

    }
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44049806

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档