Answer the question
In order to leave comments, you need to log in
How to disable JS script for older browsers?
Hello. The "SmoothScroll" script is connected to my WordPress theme via functions.php, for example. I need to make it so that when opening a site in IE (any), it is disabled or ignored by the browser.
Found the following solution in PHP:
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) $body_browser_class = 'ie';
wp_enqueue_script()
to put check. But in my opinion this is some kind of perverse way. Can this be done in a simpler way or in general using WP? Answer the question
In order to leave comments, you need to log in
Why not do this check in the script itself? Or when connecting using conditional comments.
htmlbook.ru/samlayout/internet-explorer/uslovnye-k...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question