ajax.abort 终止AJAX请求

                          
            $(document).ready(function ()
            {
                var ajax;
                $('#choice').change(function()
                {
                    if(ajax)
                    {
                        ajax.abort();
                    }
                    ajax = $.get(
                        'wait.php',
                        { what : $(this).val() },
                        function(response)
                        {
                            $('#response').html(response);
                        },
                        'html'
                    );
                });
            });
posted on 2014-04-24 22:34  思静  阅读(13687)  评论(0编辑  收藏  举报