Faced such a problem - there is a need to execute a certain script on JS , but since in the old versions of IOS for Iphone 6 (Safari version 8 and below) some methods from this script are not supported, and the alternative to come up with a very long and labor-intensive. It was decided not to run the execution of this script. Something like this:
window.onload = function() { console.log("OK"); function animationCounter() { if ((body.width() < 350) && (userAgent.match(/iPad/i) || userAgent.match(/iPhone/i))) { console.log('Это яблофон'); return; } console.log("Мы пользуемся адекватным браузером, работаем дальше"); } } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> but it turned out that everything is not so simple, and the browser's parser will not care if the function is initialized or not, it just freezes if it cannot “read” a specific function at the time of loading the page.
The question is how to get around this? How do you tell browser Safari v8 and below that if you can’t do something, then just skip, and don’t interrupt all other scripts on the page?
typeof canvas.addColorStop === 'function'. - Tsyklop