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

js中Ajax问题
让Ajax的回调时间缩短,如下面的代码是有时先执行 success: function(contents){}有时先执行 js中的alert("你好")。我想要的结果是 先判断Ajax的success: function(contents) {}
然后在执行js中的alert("你好")有办法吗?????。                         

<script language="javascript" type="text/javascript">                            
                  $.ajax({
                            url: "Default.aspx",
                            type: 'POST',
                            timeout: 100,

                            Error: function() {
                                alert(Error);
                            },
                            success: function(contents) {
                                alert(contents);
                            }
                        });

                alert("你好")
</script>