The plugin is activated.
The rest of the plugin works fine, but when I load the page, nothing happens. I also view the source and the script is not in the footer as it should be.
I tested this with a variety of other methods, but I'm completely missing what I'm doing wrong.
In my plugin I have:
if (!class_exists('AC')) {
class AC
{
function __construct()
{
//...other things that work...
add_action('wp_enqueue_scripts', array($this, 'enqueueScripts'));
}
function enqueueScripts()
{
wp_enqueue_script(
'ac-ajax-js',
'/wp-content/plugins/ac/js/track.js',
array(),
'1.0',
true
);
}
}
$AC = new AC();
}
In the js file I have:
alert("Plugin Loaded!");