0

I am working on a WordPress site - that has a ton of custom code and plugins and all sorts of JQuery, and bootstrap, and frameworks, loading.

At the very bottom of the last loading footer - I place:

<script>

    if(window.jQuery){

        $(document).ready(function(){ 
          alert("I am ready."); 
        });

    }

</script>

and I get the error:

Uncaught TypeError: $ is not a function

Clearly - JQuery is loaded. I've tried placing other JQuery there as well - besides the on load - and I get the same error.

Why do I get the $ not a function error?

1 Answers1

3

jQuery is loaded in safe mode in Wordpress. Try:

<script>

    if(window.jQuery){

        jQuery(document).ready(function(){ 
          alert("I am ready."); 
        });

    }

</script>
Shane Lessard
  • 655
  • 1
  • 8
  • 18