回答編集履歴
1
追記
test
CHANGED
@@ -5,3 +5,149 @@
|
|
5
5
|
そうですね。
|
6
6
|
|
7
7
|
どうしても順序が必要なのであれば、$.whenやpromiseで処理すれば良いと思います
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
# 追記
|
14
|
+
|
15
|
+
今回はIE対応のためdialogではなくdivで処理します
|
16
|
+
|
17
|
+
- mypage.htm
|
18
|
+
|
19
|
+
```HTML
|
20
|
+
|
21
|
+
<body>
|
22
|
+
|
23
|
+
<input type="button" value="go">
|
24
|
+
|
25
|
+
<span id="hoge"></span>
|
26
|
+
|
27
|
+
<div id="modal">
|
28
|
+
|
29
|
+
<p>
|
30
|
+
|
31
|
+
<div>Loading ...</div>
|
32
|
+
|
33
|
+
<hr>
|
34
|
+
|
35
|
+
<input type="button" value="cancel">
|
36
|
+
|
37
|
+
</p>
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="modal_back"></div>
|
42
|
+
|
43
|
+
</body>
|
44
|
+
|
45
|
+
```
|
46
|
+
|
47
|
+
```CSS
|
48
|
+
|
49
|
+
#modal{
|
50
|
+
|
51
|
+
z-index:2;
|
52
|
+
|
53
|
+
display:block;
|
54
|
+
|
55
|
+
position:absolute;
|
56
|
+
|
57
|
+
left:45%;
|
58
|
+
|
59
|
+
top:45%;
|
60
|
+
|
61
|
+
border-style:outset;
|
62
|
+
|
63
|
+
width:100px;
|
64
|
+
|
65
|
+
background-Color:e0e0e0;
|
66
|
+
|
67
|
+
}
|
68
|
+
|
69
|
+
#modal_back{
|
70
|
+
|
71
|
+
z-index:1;
|
72
|
+
|
73
|
+
display:block;
|
74
|
+
|
75
|
+
position:absolute;
|
76
|
+
|
77
|
+
top:0px;
|
78
|
+
|
79
|
+
left;0px;
|
80
|
+
|
81
|
+
width:100%;
|
82
|
+
|
83
|
+
height:100%;
|
84
|
+
|
85
|
+
background-Color:rgba(0,0,128,0.6);
|
86
|
+
|
87
|
+
}
|
88
|
+
|
89
|
+
```
|
90
|
+
|
91
|
+
```javascript
|
92
|
+
|
93
|
+
$(function(){
|
94
|
+
|
95
|
+
var myxhr;
|
96
|
+
|
97
|
+
$('#modal,#modal_back').hide();
|
98
|
+
|
99
|
+
$('input[type=button][value=go]').on('click',function(){
|
100
|
+
|
101
|
+
$('#modal,#modal_back').show();
|
102
|
+
|
103
|
+
myxhr=$.ajax({
|
104
|
+
|
105
|
+
"url":"send.php",
|
106
|
+
|
107
|
+
"cache":false,
|
108
|
+
|
109
|
+
}).done(function(data){
|
110
|
+
|
111
|
+
$('#modal,#modal_back').hide();
|
112
|
+
|
113
|
+
$('#hoge').html(data);
|
114
|
+
|
115
|
+
});
|
116
|
+
|
117
|
+
});
|
118
|
+
|
119
|
+
$('#modal input[type=button][value=cancel]').on('click',function(){
|
120
|
+
|
121
|
+
if(myxhr) myxhr.abort();
|
122
|
+
|
123
|
+
$('#modal,#modal_back').hide();
|
124
|
+
|
125
|
+
});
|
126
|
+
|
127
|
+
});
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
```
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
- send.php
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
※3秒待って現在の日時を表示する
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
```PHP
|
144
|
+
|
145
|
+
<?PHP
|
146
|
+
|
147
|
+
sleep(3);
|
148
|
+
|
149
|
+
print date("Y-m-d H:i:s");
|
150
|
+
|
151
|
+
?>
|
152
|
+
|
153
|
+
```
|