-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
43 lines (38 loc) · 953 Bytes
/
Copy pathtest.html
File metadata and controls
43 lines (38 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<! DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="vendor/jquery-1.10.1.js"></script>
<script type="text/javascript" src="src/jquery.ajaxLoading.js"></script>
</head>
<body>
<div><input id="btnStartLoading" type="button" value="Start loading" /></div>
<div id="test"></div>
<script type="text/javascript">
$(function(){
$.fn.ajaxLoading().register([
{
element:'#test',
type:'image',
src:'img/indicator.gif',
url:['http://localhost:3000/','http://localhost:3000/json']
}
]);
$.fn.ajaxLoading({
onStatistics:true
});
$('#btnStartLoading').on('click',function(){
$.ajax({
url:"http://localhost:3000/"
});
$.ajax({
url:"http://localhost:3000/json",
dataType:'json'
}).done(function(){
alert($.fn.ajaxLoading().getStatistics()[0].timeCost);
alert($.fn.ajaxLoading().getStatistics()[0].times);
});
});
});
</script>
</body>
</html>