I've included the javascript by
wp_enqueue_script('slider', plugins_url( 'slider.js', __FILE__ ) );
with just a simple
$(document).ready(function () {
alert("alert");
});
It shows up in the browser but doesn't prompt me with "alert".
PS: Forgot to mention I've also included the jquery, but still not working.
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
wp_enqueue_script('jquery');
In addition to the answers, I also had to tell wordpress that my script depends on jQuery
wp_enqueue_script( 'slider', plugins_url( 'slider.js', __FILE__ ),array('jquery') );