简体   繁体   中英

wordpress javascript load order

I have those scripts loading for a grid in wordpress..

<script src="/wp-includes/js/masonry.pkgd.min.js"></script>
<script src="/wp-includes/js/colorfinder-1.1.js"></script>
<script src="/wp-includes/js/imagesloaded.pkgd.min.js"</script>
<script src="/wp-includes/js/classie.js"></script>
<script src="/wp-includes/js/gridScrollFx.js"></script>
<script>new GridScrollFx( document.getElementById( 'grid' ), { viewportFactor : 0.4 } );</script>

And.. They work fine on a simple HTML page, but if I move everything to wordpress I get an error; "Uncaught ReferenceError: classie is not defined"

So I suppose that is because it hasn't loaded classie.js before moving on to gridscrollfx, but why if it's before it? It works on html but no on wordpress.

Btw, I tried moving it up and down but it just doesn't work, comes up with similar errors.

You have not completed the closing tag in one script tag:

<script src="/wp-includes/js/masonry.pkgd.min.js"></script>
<script src="/wp-includes/js/colorfinder-1.1.js"></script>
<script src="/wp-includes/js/imagesloaded.pkgd.min.js"></script> <!-- Close script tag here after quotes -->
<script src="/wp-includes/js/classie.js"></script>
<script src="/wp-includes/js/gridScrollFx.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM