Home>

Currently, the site created in HTML has been changed to the wordpress site.
In HTML, an error will occur if the javascript that runs is set to wordpress.

Error message
All the following errors are displayed.
Uncaught ReferenceError: jQuery is not defined
Applicable source code
<script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type = 'text/javascript' src = '●●●/js/jquery.inview.min.js'></script>
<script type = 'text/javascript' src = '●●●/js/function.js'></script>
<script type = 'text/javascript' src = '●●●/js/sp-menu.js'></script>
<script type = 'text/javascript' src = '●●●/js/scroll.js'></script>
<script type = 'text/javascript' src = '●●●/js/wideslider.js'></script>
<script type = 'text/javascript' src = '●●●/js/slick.min.js'></script>
<script type = 'text/javascript' src = '●●●/js/admin-bar.min.js? ver = 5.2.3'></script>
<script type = 'text/javascript' src = '●●●/js/wp-embed.min.js? ver = 5.2.3'></script>

-Change all javascript $s to jQuery
・ Window.addEventListener (Change to 'DOMContentLoaded', function () {

I tried to change the reading order and write it in header.php and function.php, but it still does not work with an error.

Thanks for your professorship.

  • Answer # 1

    In WP, read js using basic wp_enqueue_script

    Please use jQuery built in WP
    Plug-ins that use jQuery may cause malfunctions

    Unable to read http js file from https site
    You can read https from http so you can use basic https
    Please check that much