Adding a simple Javascript file with a plugin

I think you are missing the trigger… your javascript should be something like this in order for it to trigger when the page is loaded:

$( document ).ready(function() {
    alert( "ready!" );
});

tech