WordPress.org

Ready to get started?Download WordPress

Forums

wp_enqueue_script appearing not to work (2 posts)

  1. techxplorer
    Member
    Posted 6 years ago #

    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');
  2. nielowait
    Member
    Posted 5 years ago #

    I don't know, but I came across the same problem, and your issue actually provided me with my solution. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic