Javascript included but alert() function not working
<p>I've included the javascript by </p>

<pre><code>wp_enqueue_script('slider', plugins_url( 'slider.js', __FILE__ ) );
</code></pre>

<p>with just a simple</p>

<pre><code>$(document).ready(function () {
    alert("alert");
});
</code></pre>

<p>It shows up in the browser but doesn't prompt me with "alert".</p>

<p>PS: Forgot to mention I've also included the jquery, but still not working.</p>

<pre><code>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');
</code></pre>

<hr>

<p>In addition to the answers, I also had to tell wordpress that my script depends on jQuery</p>

<pre><code>wp_enqueue_script( 'slider', plugins_url( 'slider.js', __FILE__ ),array('jquery') );
</code></pre>
