2 days ago my javascript was located in my footer folder running correctly, until suddenly it stopped working. I was lazy to do the proper way of enqueueing, so I officially did that to see if it would resolve the problem, it did not. When I inspect the html, the javascript is loaded within, but does not play. So then I thought it was the script, and then test ran a script I know is working fine from tuts plus, again, nothing.
Here's their script, which of course I rearranged to match my folder layout.
<?php
function twentyfifteen_child_scripts() {
wp_enqueue_script( 'transition js', get_stylesheet_directory_uri() . '/js/transition.js' );
}
add_action('wp_enqueue_scripts','twentyfifteen_child_scripts');
And within my transition.js folder there is...
alert("yo");
Checking the console on chrome two errors pop up:
(1) Failed to load resource: the server responded with a status of 404 (Not Found)
(2) Uncaught TypeError: $ is not a function
Which is referring to this script.
<script type="text/javascript">
$(".menu-button").click(function () {
$(this).parents(".wrapper").toggleClass("show-menu");
});
</script>
This script works fine on HTML testbeds.
I'm assuming the problem has nothing to do with this code, but I'd thought it would help. Please, if anyone is fammiliar or has heard of a situation similar to do this happening, offer some advice on it, feel like I'm in a dead end right now. Thanks.