1

I am working on creating a plugin. The first thing I do is enqueue my css and javascript files. If I view the page source, I am seeing both files loaded. The problem I am having, is I have some functions in the javascript file that won't load. I believe the issue is that the javascript file is loaded before the plugin content. This is probably really easy, but how do I force the javascript file to reload after my plugin content is loaded, or to be the last thing loaded?

1 Answer 1

0

Use a construct like this one:

(function( $ ) {
    'use strict';

    $( document ).ready( function() {
        // Put your code here
    });

})( jQuery );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.