twan
twan

Reputation: 2659

Blank screen on internet explorer 11 due to script error

I have an error which stops my entire site from showing. Everything is loaded, I can even hover anchor tags but the entire page is just white.

The following error shows up (only in IE) in the console:

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

Which refers to my script that gives a typing effect (changes strings and animates them like someone is typing the words). When I comment out my script then the site shows like normal.

My script:

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) {

    }

I can't figure out what the error means, all the vars have different names so that is not it. What is causing the error?

Upvotes: 0

Views: 279

Answers (1)

TheErikPowell
TheErikPowell

Reputation: 85

typeSpeed appears twice.

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) {

    }

Upvotes: 1

Related Questions