日期:2014-05-16  浏览次数:20777 次

用jquery时,浏览器的兼容问题,在火狐下是好的,但是在IE上跟360上都不行
 <script type="text/javascript">
        function checkFun() {
            // alert(1);
            $.ajax(
                {
                    type: "post",
                    url: "Index.aspx/GetResult",
                    data: '{"name":"' + $("#Textbox1").val().trim() + '"}',
                    datatype: "json",
                    contentType: "application/json;charset=UTF-8",
                    success: function (data) {
                        if (data.d == "false") {
                            alert("该用户不存在");
                            return;
                        }
                    }
                }
                );
        }

    </script>
------解决方案--------------------
增加error回调看输出什么内容
        function checkFun() {
            // alert(1);
            $.ajax(
                {
                    type: "post",
                    url: "Index.aspx/GetResult",
                    data: '{"name":"' + $("#Textbox1").val().trim() + '"}',
                    datatype: "json",
                    contentType: "application/json;charset=UTF-8",
error:function(xhr){alert(xhr.r