WordPress.org

Support

Support » Plugins and Hacks » wp_enqueue_script appearing not to work

wp_enqueue_script appearing not to work

  • Dear All,

    I’m trying to include some JavaScript in the header of my plugins admin page. Any idea on why this deson’t work:

    wp_enqueue_script('my-plugin-1', '/wp-content/plugins/my-plugin/javascript1.js', array('jquery'));
    wp_enqueue_script('my-plugin-2', '/wp-content/plugins/my-plugin/javascript2', array('my-plugin-1'));

    When this does?

    wp_register_script('my-plugin-1', '/wp-content/plugins/my-plugin/javascript1.js', array('jquery'));
    wp_register_script('my-plugin-2', '/wp-content/plugins/my-plugin/javascript2', array('my-plugin-1'));
    wp_print_scripts('my-plugin-2');
Viewing 1 replies (of 1 total)
  • I don’t know, but I came across the same problem, and your issue actually provided me with my solution. Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘wp_enqueue_script appearing not to work’ is closed to new replies.
Skip to toolbar