• Resolved pixeldreamer

    (@pixeldreamer)


    I’ve been trying to troubleshoot an issue I’ve been having with wp_enqueue_script for over a week now. I’ve read everything I can find on wp_enqueue_script and nothing addresses the problem I’m experiencing.

    Here’s the code in my functions.php:

    function my_scripts() {
        wp_enqueue_script( 'jquery' );
        wp_enqueue_script( 'modernizr', 'http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js', 'jquery', false );
    }
    add_action( 'wp_enqueue_scripts', 'my_scripts' );

    The issue I’m having is that modernizr isn’t getting loaded. If I view the source that’s being generated I see this:

    <script type='text/javascript' src='/ajax/libs/modernizr/2.0.6/modernizr.min.js?ver=3.5.1'></script>

    Somehow the remote url is being removed. My question is why? And how do I get it to load from the remote source I’ve specified?

    Thanks in advance for any help you’re able to provide.

    Best,
    Mac

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wp_enqueue_script won't load remote scripts’ is closed to new replies.