Monday, 4 October 2021

Refused to execute script because its MIME type ('image/gif') is not executable

I have added this code to my website (before the closing body):

<script type="text/javascript">
    var vglnk = {key: '123456789'};
    (function(d, t) {
        var s = d.createElement(t);
            s.type = 'text/javascript';
            s.async = true;
            s.src = '//cdn.viglink.com/api/vglnk.js';
        var r = d.getElementsByTagName(t)[0];
            r.parentNode.insertBefore(s, r);
    }(document, 'script'));
</script>

However, in Chrome's developer console I get the following error:

www.mywebsite.com/:1 Refused to execute script from 'https://api.viglink.com/api/sync.js?key=123456789' because its MIME type ('image/gif') is not executable.

Why is this happening? What am I doing wrong?



from Refused to execute script because its MIME type ('image/gif') is not executable

No comments:

Post a Comment