Ajax post does not work after document ready
<p>I want to make an Ajax call after my document is ready. Here is my code :</p>

<pre><code>&lt;script&gt;

        $(window).bind("load", function () {
            getCategories();

        });
    &lt;/script&gt;

    &lt;script&gt;
        function getCategories() {
            $.ajax({
                type: "POST",
                url: '@Url.Action("GetAllCategoryTest", "Category")',
                dataType: "html",
                contentType: "application/json",
                async: false,
                success: function (result) {
                    var categoryList = JSON.parse(result);

                    $.each(categoryList.result, function (i) {
                        $("#menuCategory").append('&lt;li&gt;' + categoryList.result[i].CategoryName + '&lt;/li&gt;');


                    });

                }
            });
        }
    &lt;/script&gt;
</code></pre>

<p>My ajax post works without using window.bind but I have to run my ajax post after my document is loaded. </p>