Bug Tracker

Ticket #3939: jQueryBug3939.aspx

File jQueryBug3939.aspx, 1.4 KB (added by jfk, 11 years ago)
Line 
1<%@ Page Language="C#" %>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4<script runat="server">
5        protected override void OnLoad(EventArgs e) {
6                base.OnLoad(e);
7                System.Threading.Thread.Sleep(int.Parse(string.IsNullOrEmpty(Request["sleep"]) ? "0" : Request["sleep"]));//wait to trigger timeout in AJAX request, must be server side
8        }
9</script>
10
11<html xmlns="http://www.w3.org/1999/xhtml">
12<head runat="server">
13    <title>jQuery bug 3939 test case</title>
14        <script type="text/javascript" src="jQuery.aspx"></script>
15        <script type="text/javascript">var console2 = {};console2.log = function() { $('#Log').append($.map(Array.prototype.slice.call(arguments), function(a) { return a+""; }).join(" ") + "<" + "br/>"); };</script>
16        <script type="text/javascript">
17        $(function() {
18                $.ajax({
19                        url: 'jQueryBug3939.aspx?sleep=2000',
20                        type: 'GET',
21                        cache: false,
22                        data: "",
23                        dataType: 'text',
24                        timeout: 1000,
25                        success: function(data, textStatus) { console2.log('success', textStatus); },
26                        error: function (xhr, textStatus, errorThrown) { console2.log('error', textStatus); },
27                        beforeSend: function(xhr) { console2.log('beforeSend'); },
28                        complete: function(xhr, textStatus) { console2.log('complete', textStatus); }
29                });
30        });
31        </script>
32</head>
33<body>
34<div id='Log'></div>
35</body>
36</html>