Remove type=”text/javascript”
-
I added code to the functions.php file:
add_filter('script_loader_tag', 'js_atr', 10, 2); function js_atr($tag, $handle) { return str_replace(array('type="text/javascript"', "type='text/javascript'"), '', $tag); }
After that, all “type=”text/javascript”” are disappeared, except those that add a plugin.
It looks like this:
<script src=’https://code.jquery.com/jquery-3.3.1.min.js’></script>
<script type=”text/javascript” src=”https://mydomain/files/cache/minify/65f03.js”></script>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Remove type=”text/javascript”’ is closed to new replies.