jQuery function on $(document).ready(function () is not working calling from the locally hosted URL
<p>This code always execute error function.</p>

<pre><code>$.ajax({
    type: "POST",
    contentType: "application/json; charset=utf-8",
    url: "http://localhost:3869/api/session",
    data: "{item:}",
    dataType: "json",
    timeout: 10000,
    success: function(data) {
        alert('');
    },
    error: function(result) {
        alert('Error');
    }
});​
</code></pre>
