Answer the question
In order to leave comments, you need to log in
Scripts not working in Safari?
Good afternoon! I made a preloader, after loading the body, the preloader is assigned the done
HTML class:
<div class="hellopreloader" id="page-preloader">
<div class="loader"></div>
</div>
<script type="text/javascript">
var preloaderDiv = document.getElementById('page-preloader');
var preloader = document.getElementById('page-preloader');
document.body.onload = function() {
setTimeout(function () {
if (!preloader.classList.contains('done')) {
preloader.classList.add('done');
}
}, 1000);
}
</script>
The source list for Content Security Policy directive 'script-src' contains an invalid source: ''strict-dynamic''. It will be ignored.
Answer the question
In order to leave comments, you need to log in
safari, as far as I remember, does not understand document.body.onload
try window.onload
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question