質問編集履歴
2
削除された内容の復元を行いました
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
ajax非同期でラジオボタンやチェックボックスでの条件検索を組み合わせたい
|
test
CHANGED
@@ -1,3 +1,387 @@
|
|
1
|
+
### 前提・実現したいこと
|
2
|
+
|
3
|
+
Spring bootで、データベースのデータを表示させ、非同期で絞り込んで検索が出来るサイト製作をしております。
|
4
|
+
|
5
|
+
現状だとラジオボタン、チェックボックス、ソートボタン、選択をリセットするボタンをそれぞれ非同期で実装できたのですが、それぞれが独立しており、ラジオボタン+チェックボタンで細かい検索が出来ない状態です。
|
6
|
+
|
7
|
+
ソートボタンも同じく、ラジオボタンやチェックボックスで絞り込んだ後にソートボタンを押しても、検索結果をソートするのではなく、データベースの全てのデータをソートして表示してしまいます。
|
8
|
+
|
9
|
+
ラジオボタンとチェックボックスを組み合わせて検索したり、検索結果からソートできるようにするにはどうしたらいいでしょうか?
|
10
|
+
|
11
|
+
### 該当のソースコード
|
12
|
+
|
13
|
+
```HTML
|
14
|
+
|
15
|
+
<body>
|
16
|
+
|
17
|
+
<h1>
|
18
|
+
|
19
|
+
<a href="index.html">ラーメン店検索</a>
|
20
|
+
|
21
|
+
</h1>
|
22
|
+
|
23
|
+
<hr />
|
24
|
+
|
25
|
+
<p class="pagetop"><a href="#wrap">トップへ戻る</a></p>
|
26
|
+
|
27
|
+
<div id="form">
|
28
|
+
|
29
|
+
<div class="filter-taste">
|
30
|
+
|
31
|
+
<label>味</label> <br /> <input type="radio" name="rd" value="醤油"
|
32
|
+
|
33
|
+
id="chk01" /><label for="chk01">醤油</label> <input type="radio"
|
34
|
+
|
35
|
+
name="rd" value="塩" id="chk02" /><label for="chk02">塩</label> <input
|
36
|
+
|
37
|
+
type="radio" name="rd" value="味噌" id="chk03" /><label for="chk03">味噌</label>
|
38
|
+
|
39
|
+
<input type="radio" name="rd" value="とんこつ" id="chk04" /><label
|
40
|
+
|
41
|
+
for="chk04">とんこつ</label> <input type="radio" name="rd" value="エビ"
|
42
|
+
|
43
|
+
id="chk05" /><label for="chk05">エビ</label>
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<br /><br/>
|
48
|
+
|
49
|
+
<div class="filter-place">
|
50
|
+
|
51
|
+
<label>場所</label> <br />
|
52
|
+
|
53
|
+
<input type="checkbox" name="place" value="東京都" id="1" /><label for="1">東京都</label>
|
54
|
+
|
55
|
+
<input type="checkbox" name="place" value="埼玉県" id="2"/><label for="2">埼玉県</label>
|
56
|
+
|
57
|
+
<input type="checkbox" name="place" value="千葉県" id="3"/><label for="3">千葉県</label><br/>
|
58
|
+
|
59
|
+
<input type="checkbox" name="place" value="神奈川県" id="4"/><label for="4">神奈川県</label>
|
60
|
+
|
61
|
+
<input type="checkbox" name="place" value="栃木県" id="5"/><label for="5">栃木県</label>
|
62
|
+
|
63
|
+
<input type="checkbox" name="place" value="茨城県" id="6"/><label for="6">茨城県</label>
|
64
|
+
|
65
|
+
<input type="checkbox" name="place" value="群馬県" id="7"/><label for="7">群馬県</label>
|
66
|
+
|
67
|
+
</div>
|
68
|
+
|
69
|
+
<br/><br/>
|
70
|
+
|
71
|
+
<input type="button" name="priceSort" value="最低価格安順" />
|
72
|
+
|
73
|
+
<input type="button" name="priceSort2" value="最低価格高順" />
|
74
|
+
|
75
|
+
<br/><br/>
|
76
|
+
|
77
|
+
<input type="button" name="reset" value="リセット" />
|
78
|
+
|
79
|
+
<form method="get" th:action="index" th:object="${searchForm}">
|
80
|
+
|
81
|
+
<div class="keyword"><br/>
|
82
|
+
|
83
|
+
<label>キーワード</label> <input name="keyword" type="text" maxlength="32"
|
84
|
+
|
85
|
+
th:field="*{keyword}" /> <input class="button" type="submit"
|
86
|
+
|
87
|
+
value="検索" />
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
</form>
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div id="recordList">
|
96
|
+
|
97
|
+
<th:block th:each="record : ${recordList}" th:object="${record}">
|
98
|
+
|
99
|
+
<div class="item">
|
100
|
+
|
101
|
+
<div class="name">
|
102
|
+
|
103
|
+
<label>店名:</label> <a th:href="*{url}" target="_blank"
|
104
|
+
|
105
|
+
th:text="*{name}">店名</a>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<br />
|
110
|
+
|
111
|
+
<div class="taste">
|
112
|
+
|
113
|
+
<label>味:</label> <span th:text="*{taste}">味</span>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<br />
|
118
|
+
|
119
|
+
<div class="place">
|
120
|
+
|
121
|
+
<label>場所:</label> <span th:text="*{place}">場所</span>
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<br />
|
126
|
+
|
127
|
+
<div class="price">
|
128
|
+
|
129
|
+
<label>最低価格:</label> <span th:text="*{price}">値段</span>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<br />
|
134
|
+
|
135
|
+
<div class="imgpass">
|
136
|
+
|
137
|
+
<img th:src="*{imgpass}"></img>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
</div>
|
142
|
+
|
143
|
+
</th:block>
|
144
|
+
|
145
|
+
</div>
|
146
|
+
|
147
|
+
</body>
|
148
|
+
|
149
|
+
```
|
150
|
+
|
151
|
+
```jquery
|
152
|
+
|
153
|
+
$(function() {
|
154
|
+
|
155
|
+
// ラジオボタンにチェックしたら発動
|
156
|
+
|
157
|
+
$('input[name="rd"]').click(function() {
|
158
|
+
|
159
|
+
var JSONdata ={keyword:$('input[name="rd"]:checked').val()};
|
160
|
+
|
161
|
+
$.ajax({
|
162
|
+
|
163
|
+
headers: {
|
164
|
+
|
165
|
+
'Accept': 'application/json',
|
166
|
+
|
167
|
+
'Content-Type': 'application/json'
|
168
|
+
|
169
|
+
},
|
170
|
+
|
171
|
+
url:'taste',
|
172
|
+
|
173
|
+
type:'POST',
|
174
|
+
|
175
|
+
dataType:'json',
|
176
|
+
|
1
|
-
|
177
|
+
contentType:"application/json",
|
178
|
+
|
2
|
-
|
179
|
+
data:JSON.stringify(JSONdata),
|
180
|
+
|
181
|
+
success:function(result){
|
182
|
+
|
183
|
+
function viewMessages(result){
|
184
|
+
|
185
|
+
$('#recordList').empty();
|
186
|
+
|
187
|
+
for (var index in result){
|
188
|
+
|
189
|
+
$('#recordList').append('<div class="item">'+
|
190
|
+
|
191
|
+
'<div class="name">店名: <a href=' + result[index].url + ' target="_blank">'+ result[index].name + '</a></div><br/>' +
|
192
|
+
|
193
|
+
'<div class="taste"><span>味: ' + result[index].taste + '</span></div><br/>' +
|
194
|
+
|
195
|
+
'<div class="place"><span>場所: ' + result[index].place + '</span></div><br/>' +
|
196
|
+
|
197
|
+
'<div class="price"><span>値段: ' + result[index].price + '</span></div><br/>' +
|
198
|
+
|
199
|
+
'<div class="imgpass"><img src='+ result[index].imgpass + '></img></div></div><br/>');
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
}
|
204
|
+
|
205
|
+
viewMessages(result);
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
});
|
210
|
+
|
211
|
+
});
|
212
|
+
|
213
|
+
//チェックボックスを選択したら発動
|
214
|
+
|
215
|
+
$('input[name="place"]').click(function() {
|
216
|
+
|
217
|
+
var sendList = {};
|
218
|
+
|
219
|
+
var sendObj = [];
|
220
|
+
|
221
|
+
$('input[name="place"]:checked').each(function(i){
|
222
|
+
|
223
|
+
sendObj.push($(this).val());
|
224
|
+
|
225
|
+
});
|
226
|
+
|
227
|
+
sendList["places"] = sendObj;
|
228
|
+
|
229
|
+
$.ajax({
|
230
|
+
|
3
|
-
|
231
|
+
headers: {
|
232
|
+
|
233
|
+
'Accept': 'application/json',
|
234
|
+
|
235
|
+
'Content-Type': 'application/json'
|
236
|
+
|
237
|
+
},
|
238
|
+
|
239
|
+
url:'place',
|
240
|
+
|
241
|
+
type:'POST',
|
242
|
+
|
243
|
+
dataType:'json',
|
244
|
+
|
245
|
+
contentType:"application/json",
|
246
|
+
|
247
|
+
data:JSON.stringify(sendList),
|
248
|
+
|
249
|
+
success:function(result){
|
250
|
+
|
251
|
+
function viewMessages(result){
|
252
|
+
|
253
|
+
$('#recordList').empty();
|
254
|
+
|
255
|
+
for (var index in result){
|
256
|
+
|
257
|
+
$('#recordList').append('<div class="item">'+
|
258
|
+
|
259
|
+
'<div class="name">店名: <a href=' + result[index].url + ' target="_blank">'+ result[index].name + '</a></div><br/>' +
|
260
|
+
|
261
|
+
'<div class="taste"><span>味: ' + result[index].taste + '</span></div><br/>' +
|
262
|
+
|
263
|
+
'<div class="place"><span>場所: ' + result[index].place + '</span></div><br/>' +
|
264
|
+
|
265
|
+
'<div class="price"><span>値段: ' + result[index].price + '</span></div><br/>' +
|
266
|
+
|
267
|
+
'<div class="imgpass"><img src='+ result[index].imgpass + '></img></div></div><br/>');
|
268
|
+
|
269
|
+
}
|
270
|
+
|
271
|
+
}
|
272
|
+
|
273
|
+
viewMessages(result);
|
274
|
+
|
275
|
+
}
|
276
|
+
|
277
|
+
});
|
278
|
+
|
279
|
+
});
|
280
|
+
|
281
|
+
//ソートボタンを押したら発動
|
282
|
+
|
283
|
+
$('input[name="priceSort"]').click(function() {
|
284
|
+
|
285
|
+
$.ajax({
|
286
|
+
|
287
|
+
headers: {
|
288
|
+
|
289
|
+
'Accept': 'application/json',
|
290
|
+
|
291
|
+
'Content-Type': 'application/json'
|
292
|
+
|
293
|
+
},
|
294
|
+
|
295
|
+
url:'priceSort',
|
296
|
+
|
297
|
+
type:'POST',
|
298
|
+
|
299
|
+
dataType:'json',
|
300
|
+
|
301
|
+
contentType:"application/json",
|
302
|
+
|
303
|
+
success:function(result){
|
304
|
+
|
305
|
+
function viewMessages(result){
|
306
|
+
|
307
|
+
$('#recordList').empty();
|
308
|
+
|
309
|
+
for (var index in result){
|
310
|
+
|
311
|
+
$('#recordList').append('<div class="item">'+
|
312
|
+
|
313
|
+
'<div class="name">店名: <a href=' + result[index].url + ' target="_blank">'+ result[index].name + '</a></div><br/>' +
|
314
|
+
|
315
|
+
'<div class="taste"><span>味: ' + result[index].taste + '</span></div><br/>' +
|
316
|
+
|
317
|
+
'<div class="place"><span>場所: ' + result[index].place + '</span></div><br/>' +
|
318
|
+
|
319
|
+
'<div class="price"><span>値段: ' + result[index].price + '</span></div><br/>' +
|
320
|
+
|
321
|
+
'<div class="imgpass"><img src='+ result[index].imgpass + '></img></div></div><br/>');
|
322
|
+
|
323
|
+
}
|
324
|
+
|
325
|
+
}
|
326
|
+
|
327
|
+
viewMessages(result);
|
328
|
+
|
329
|
+
}
|
330
|
+
|
331
|
+
});
|
332
|
+
|
333
|
+
});
|
334
|
+
|
335
|
+
$('input[name="priceSort2"]').click(function() {
|
336
|
+
|
337
|
+
$.ajax({
|
338
|
+
|
339
|
+
headers: {
|
340
|
+
|
341
|
+
'Accept': 'application/json',
|
342
|
+
|
343
|
+
'Content-Type': 'application/json'
|
344
|
+
|
345
|
+
},
|
346
|
+
|
347
|
+
url:'priceSort2',
|
348
|
+
|
349
|
+
type:'POST',
|
350
|
+
|
351
|
+
dataType:'json',
|
352
|
+
|
353
|
+
contentType:"application/json",
|
354
|
+
|
355
|
+
success:function(result){
|
356
|
+
|
357
|
+
function viewMessages(result){
|
358
|
+
|
359
|
+
$('#recordList').empty();
|
360
|
+
|
361
|
+
for (var index in result){
|
362
|
+
|
363
|
+
$('#recordList').append('<div class="item">'+
|
364
|
+
|
365
|
+
'<div class="name">店名: <a href=' + result[index].url + ' target="_blank">'+ result[index].name + '</a></div><br/>' +
|
366
|
+
|
367
|
+
'<div class="taste"><span>味: ' + result[index].taste + '</span></div><br/>' +
|
368
|
+
|
369
|
+
'<div class="place"><span>場所: ' + result[index].place + '</span></div><br/>' +
|
370
|
+
|
371
|
+
'<div class="price"><span>値段: ' + result[index].price + '</span></div><br/>' +
|
372
|
+
|
373
|
+
'<div class="imgpass"><img src='+ result[index].imgpass + '></img></div></div><br/>');
|
374
|
+
|
375
|
+
}
|
376
|
+
|
377
|
+
}
|
378
|
+
|
379
|
+
viewMessages(result);
|
380
|
+
|
381
|
+
}
|
382
|
+
|
383
|
+
});
|
384
|
+
|
385
|
+
});
|
386
|
+
|
387
|
+
```
|
1
追記
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
この質問は除去されました。
|
test
CHANGED
@@ -1,441 +1,3 @@
|
|
1
|
-
|
1
|
+
この質問は質問者のアカウントが凍結、若しくは存在していないため、無効とさせていただきました。
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Spring bootで、データベースのデータを表示させ、非同期で絞り込んで検索が出来るサイト製作をしております。
|
6
|
-
|
7
|
-
現状だとラジオボタン、チェックボックス、ソートボタン、選択をリセットするボタンをそれぞれ非同期で実装できたのですが、それぞれが独立しており、ラジオボタン+チェックボタンで細かい検索が出来ない状態です。
|
8
|
-
|
9
|
-
ソートボタンも同じく、ラジオボタンやチェックボックスで絞り込んだ後にソートボタンを押しても、検索結果をソートするのではなく、データベースの全てのデータをソートして表示してしまいます。
|
10
|
-
|
11
|
-
ラジオボタンとチェックボックスを組み合わせて検索したり、検索結果からソートできるようにするにはどうしたらいいでしょうか?
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
まことに申し訳ありません。
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
```HTML
|
20
|
-
|
21
|
-
<body>
|
22
|
-
|
23
|
-
<h1>
|
24
|
-
|
25
|
-
<a href="index.html">ラーメン店検索</a>
|
26
|
-
|
27
|
-
</h1>
|
28
|
-
|
29
|
-
<hr />
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
<p class="pagetop"><a href="#wrap">トップへ戻る</a></p>
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
<div id="form">
|
38
|
-
|
39
|
-
<div class="filter-taste">
|
40
|
-
|
41
|
-
<label>味</label> <br /> <input type="radio" name="rd" value="醤油"
|
42
|
-
|
43
|
-
id="chk01" /><label for="chk01">醤油</label> <input type="radio"
|
44
|
-
|
45
|
-
name="rd" value="塩" id="chk02" /><label for="chk02">塩</label> <input
|
46
|
-
|
47
|
-
type="radio" name="rd" value="味噌" id="chk03" /><label for="chk03">味噌</label>
|
48
|
-
|
49
|
-
<input type="radio" name="rd" value="とんこつ" id="chk04" /><label
|
50
|
-
|
51
|
-
for="chk04">とんこつ</label> <input type="radio" name="rd" value="エビ"
|
52
|
-
|
53
|
-
id="chk05" /><label for="chk05">エビ</label>
|
54
|
-
|
55
|
-
</div>
|
56
|
-
|
57
|
-
<br /><br/>
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
<div class="filter-place">
|
62
|
-
|
63
|
-
<label>場所</label> <br />
|
64
|
-
|
65
|
-
<input type="checkbox" name="place" value="東京都" id="1" /><label for="1">東京都</label>
|
66
|
-
|
67
|
-
<input type="checkbox" name="place" value="埼玉県" id="2"/><label for="2">埼玉県</label>
|
68
|
-
|
69
|
-
<input type="checkbox" name="place" value="千葉県" id="3"/><label for="3">千葉県</label><br/>
|
70
|
-
|
71
|
-
<input type="checkbox" name="place" value="神奈川県" id="4"/><label for="4">神奈川県</label>
|
72
|
-
|
73
|
-
<input type="checkbox" name="place" value="栃木県" id="5"/><label for="5">栃木県</label>
|
74
|
-
|
75
|
-
<input type="checkbox" name="place" value="茨城県" id="6"/><label for="6">茨城県</label>
|
76
|
-
|
77
|
-
<input type="checkbox" name="place" value="群馬県" id="7"/><label for="7">群馬県</label>
|
78
|
-
|
79
|
-
</div>
|
80
|
-
|
81
|
-
<br/><br/>
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
<input type="button" name="priceSort" value="最低価格安順" />
|
86
|
-
|
87
|
-
<input type="button" name="priceSort2" value="最低価格高順" />
|
88
|
-
|
89
|
-
<br/><br/>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
<input type="button" name="reset" value="リセット" />
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
<form method="get" th:action="index" th:object="${searchForm}">
|
98
|
-
|
99
|
-
<div class="keyword"><br/>
|
100
|
-
|
101
|
-
<label>キーワード</label> <input name="keyword" type="text" maxlength="32"
|
102
|
-
|
103
|
-
th:field="*{keyword}" /> <input class="button" type="submit"
|
104
|
-
|
105
|
-
value="検索" />
|
106
|
-
|
107
|
-
</div>
|
108
|
-
|
109
|
-
</form>
|
110
|
-
|
111
|
-
</div>
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
<div id="recordList">
|
116
|
-
|
117
|
-
<th:block th:each="record : ${recordList}" th:object="${record}">
|
118
|
-
|
119
|
-
<div class="item">
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<div class="name">
|
124
|
-
|
125
|
-
<label>店名:</label> <a th:href="*{url}" target="_blank"
|
126
|
-
|
127
|
-
th:text="*{name}">店名</a>
|
128
|
-
|
129
|
-
</div>
|
130
|
-
|
131
|
-
<br />
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
<div class="taste">
|
136
|
-
|
137
|
-
<label>味:</label> <span th:text="*{taste}">味</span>
|
138
|
-
|
139
|
-
</div>
|
140
|
-
|
141
|
-
<br />
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<div class="place">
|
146
|
-
|
147
|
-
<label>場所:</label> <span th:text="*{place}">場所</span>
|
148
|
-
|
149
|
-
</div>
|
150
|
-
|
151
|
-
<br />
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
<div class="price">
|
156
|
-
|
157
|
-
<label>最低価格:</label> <span th:text="*{price}">値段</span>
|
158
|
-
|
159
|
-
</div>
|
160
|
-
|
161
|
-
<br />
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
<div class="imgpass">
|
166
|
-
|
167
|
-
<img th:src="*{imgpass}"></img>
|
168
|
-
|
169
|
-
</div>
|
170
|
-
|
171
|
-
</div>
|
172
|
-
|
173
|
-
</th:block>
|
174
|
-
|
175
|
-
</div>
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
</body>
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
```
|
184
|
-
|
185
|
-
```jquery
|
186
|
-
|
187
|
-
$(function() {
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
// ラジオボタンにチェックしたら発動
|
192
|
-
|
193
|
-
$('input[name="rd"]').click(function() {
|
194
|
-
|
195
|
-
var JSONdata ={keyword:$('input[name="rd"]:checked').val()};
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
$.ajax({
|
200
|
-
|
201
|
-
headers: {
|
202
|
-
|
203
|
-
'Accept': 'application/json',
|
204
|
-
|
205
|
-
'Content-Type': 'application/json'
|
206
|
-
|
207
|
-
},
|
208
|
-
|
209
|
-
url:'taste',
|
210
|
-
|
211
|
-
type:'POST',
|
212
|
-
|
213
|
-
dataType:'json',
|
214
|
-
|
215
|
-
contentType:"application/json",
|
216
|
-
|
217
|
-
data:JSON.stringify(JSONdata),
|
218
|
-
|
219
|
-
success:function(result){
|
220
|
-
|
221
|
-
function viewMessages(result){
|
222
|
-
|
223
|
-
$('#recordList').empty();
|
224
|
-
|
225
|
-
for (var index in result){
|
226
|
-
|
227
|
-
$('#recordList').append('<div class="item">'+
|
228
|
-
|
229
|
-
'<div class="name">店名: <a href=' + result[index].url + ' target="_blank">'+ result[index].name + '</a></div><br/>' +
|
230
|
-
|
231
|
-
'<div class="taste"><span>味: ' + result[index].taste + '</span></div><br/>' +
|
232
|
-
|
233
|
-
'<div class="place"><span>場所: ' + result[index].place + '</span></div><br/>' +
|
234
|
-
|
235
|
-
'<div class="price"><span>値段: ' + result[index].price + '</span></div><br/>' +
|
236
|
-
|
237
|
-
'<div class="imgpass"><img src='+ result[index].imgpass + '></img></div></div><br/>');
|
238
|
-
|
239
|
-
}
|
240
|
-
|
241
|
-
}
|
242
|
-
|
243
|
-
viewMessages(result);
|
244
|
-
|
245
|
-
}
|
246
|
-
|
247
|
-
});
|
248
|
-
|
249
|
-
});
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
//チェックボックスを選択したら発動
|
254
|
-
|
255
|
-
$('input[name="place"]').click(function() {
|
256
|
-
|
257
|
-
var sendList = {};
|
258
|
-
|
259
|
-
var sendObj = [];
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
$('input[name="place"]:checked').each(function(i){
|
264
|
-
|
265
|
-
sendObj.push($(this).val());
|
266
|
-
|
267
|
-
});
|
268
|
-
|
269
|
-
sendList["places"] = sendObj;
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
$.ajax({
|
274
|
-
|
275
|
-
headers: {
|
276
|
-
|
277
|
-
'Accept': 'application/json',
|
278
|
-
|
279
|
-
'Content-Type': 'application/json'
|
280
|
-
|
281
|
-
},
|
282
|
-
|
283
|
-
url:'place',
|
284
|
-
|
285
|
-
type:'POST',
|
286
|
-
|
287
|
-
dataType:'json',
|
288
|
-
|
289
|
-
contentType:"application/json",
|
290
|
-
|
291
|
-
data:JSON.stringify(sendList),
|
292
|
-
|
293
|
-
success:function(result){
|
294
|
-
|
295
|
-
function viewMessages(result){
|
296
|
-
|
297
|
-
$('#recordList').empty();
|
298
|
-
|
299
|
-
for (var index in result){
|
300
|
-
|
301
|
-
$('#recordList').append('<div class="item">'+
|
302
|
-
|
303
|
-
'<div class="name">店名: <a href=' + result[index].url + ' target="_blank">'+ result[index].name + '</a></div><br/>' +
|
304
|
-
|
305
|
-
'<div class="taste"><span>味: ' + result[index].taste + '</span></div><br/>' +
|
306
|
-
|
307
|
-
'<div class="place"><span>場所: ' + result[index].place + '</span></div><br/>' +
|
308
|
-
|
309
|
-
'<div class="price"><span>値段: ' + result[index].price + '</span></div><br/>' +
|
310
|
-
|
311
|
-
'<div class="imgpass"><img src='+ result[index].imgpass + '></img></div></div><br/>');
|
312
|
-
|
313
|
-
}
|
314
|
-
|
315
|
-
}
|
316
|
-
|
317
|
-
viewMessages(result);
|
318
|
-
|
319
|
-
}
|
320
|
-
|
321
|
-
});
|
322
|
-
|
323
|
-
});
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
//ソートボタンを押したら発動
|
328
|
-
|
329
|
-
$('input[name="priceSort"]').click(function() {
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
$.ajax({
|
334
|
-
|
335
|
-
headers: {
|
336
|
-
|
337
|
-
'Accept': 'application/json',
|
338
|
-
|
339
|
-
'Content-Type': 'application/json'
|
340
|
-
|
341
|
-
},
|
342
|
-
|
343
|
-
url:'priceSort',
|
344
|
-
|
345
|
-
type:'POST',
|
346
|
-
|
347
|
-
dataType:'json',
|
348
|
-
|
349
|
-
contentType:"application/json",
|
350
|
-
|
351
|
-
success:function(result){
|
352
|
-
|
353
|
-
function viewMessages(result){
|
354
|
-
|
355
|
-
$('#recordList').empty();
|
356
|
-
|
357
|
-
for (var index in result){
|
358
|
-
|
359
|
-
$('#recordList').append('<div class="item">'+
|
360
|
-
|
361
|
-
'<div class="name">店名: <a href=' + result[index].url + ' target="_blank">'+ result[index].name + '</a></div><br/>' +
|
362
|
-
|
363
|
-
'<div class="taste"><span>味: ' + result[index].taste + '</span></div><br/>' +
|
364
|
-
|
365
|
-
'<div class="place"><span>場所: ' + result[index].place + '</span></div><br/>' +
|
366
|
-
|
367
|
-
'<div class="price"><span>値段: ' + result[index].price + '</span></div><br/>' +
|
368
|
-
|
369
|
-
'<div class="imgpass"><img src='+ result[index].imgpass + '></img></div></div><br/>');
|
370
|
-
|
371
|
-
}
|
372
|
-
|
373
|
-
}
|
374
|
-
|
375
|
-
viewMessages(result);
|
376
|
-
|
377
|
-
}
|
378
|
-
|
379
|
-
});
|
380
|
-
|
381
|
-
});
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
$('input[name="priceSort2"]').click(function() {
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
$.ajax({
|
390
|
-
|
391
|
-
headers: {
|
392
|
-
|
393
|
-
'Accept': 'application/json',
|
394
|
-
|
395
|
-
'Content-Type': 'application/json'
|
396
|
-
|
397
|
-
},
|
398
|
-
|
399
|
-
url:'priceSort2',
|
400
|
-
|
401
|
-
type:'POST',
|
402
|
-
|
403
|
-
dataType:'json',
|
404
|
-
|
405
|
-
contentType:"application/json",
|
406
|
-
|
407
|
-
success:function(result){
|
408
|
-
|
409
|
-
function viewMessages(result){
|
410
|
-
|
411
|
-
$('#recordList').empty();
|
412
|
-
|
413
|
-
for (var index in result){
|
414
|
-
|
415
|
-
$('#recordList').append('<div class="item">'+
|
416
|
-
|
417
|
-
'<div class="name">店名: <a href=' + result[index].url + ' target="_blank">'+ result[index].name + '</a></div><br/>' +
|
418
|
-
|
419
|
-
'<div class="taste"><span>味: ' + result[index].taste + '</span></div><br/>' +
|
420
|
-
|
421
|
-
'<div class="place"><span>場所: ' + result[index].place + '</span></div><br/>' +
|
422
|
-
|
423
|
-
'<div class="price"><span>値段: ' + result[index].price + '</span></div><br/>' +
|
424
|
-
|
425
|
-
'<div class="imgpass"><img src='+ result[index].imgpass + '></img></div></div><br/>');
|
426
|
-
|
427
|
-
}
|
428
|
-
|
429
|
-
}
|
430
|
-
|
431
|
-
viewMessages(result);
|
432
|
-
|
433
|
-
}
|
434
|
-
|
435
|
-
});
|
436
|
-
|
437
|
-
});
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
```
|