 <p>I think there is an error in your first document.ready</p> <pre><code>here : $(function() { </code></pre> <p>So the second document.ready </p> <pre><code>this one : $(document).ready(function() { </code></pre>