阅读背景:

jquery中的content-type $ .ajaxSetup()调用未被应用

来源:互联网 
    <script type="text/javascript">

           $(document).ready(function () {

                $.ajaxSetup({ 
        type: 'POST',
            url: 'AjaxService.asmx/GetBorughs',
            contentType: 'application/json; charset=uft-8',
            dataType:'json'
        });
        $('#btnCount').click(function () {

            $.ajax({
                success: function (respo) {
                    $("#log").html('').append("<ul id='boroughList'>");
                    var places = respo.d;
                    for (var i = 0; i < places.length; i++) {
                        $("#boroughList").append('<li>' + places[i].Name + ' ' + places[i].population + ' ' + places[i].created + '</li>');
                    }
                    $("#log").append('</ul>');
                }
            });
        });
    });
</script>
    <script type="text/javascript">

          



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: