Instead of


$(document).ready(function() {
    //document ready
});

Use


$(function(){
    //document ready
});