質問編集履歴
3
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,53 +16,7 @@
|
|
16
16
|
|
17
17
|
```jQuery
|
18
18
|
|
19
|
-
<script>
|
20
19
|
|
21
|
-
$(function() {
|
22
|
-
|
23
|
-
$('.search__btn').on('click', function() {
|
24
|
-
|
25
|
-
$('.lists').empty();
|
26
|
-
|
27
|
-
var searchWord = $('.search__text__input').val();
|
28
|
-
|
29
|
-
if(searchWord === '') {
|
30
|
-
|
31
|
-
$('.lists').html('<p class="message">文字が入力されていません。</p>');
|
32
|
-
|
33
|
-
return;
|
34
|
-
|
35
|
-
};
|
36
|
-
|
37
|
-
$.ajax({
|
38
|
-
|
39
|
-
url: 'https://app.rakuten.co.jp/services/api/BooksTotal/Search/20130522',
|
40
|
-
|
41
|
-
type: 'GET',
|
42
|
-
|
43
|
-
datatype: 'json',
|
44
|
-
|
45
|
-
data: {
|
46
|
-
|
47
|
-
keyword: searchWord,
|
48
|
-
|
49
|
-
applicationId: "",
|
50
|
-
|
51
|
-
booksGenreId: '001',
|
52
|
-
|
53
|
-
page: 1,
|
54
|
-
|
55
|
-
hits: 20
|
56
|
-
|
57
|
-
}
|
58
|
-
|
59
|
-
}).done(function(data) {
|
60
|
-
|
61
|
-
if(data.hits === 0) {
|
62
|
-
|
63
|
-
$('.lists').html('<p class="message">検索結果がありませんでした。<br>別のキーワードで検索してください</p>');
|
64
|
-
|
65
|
-
}
|
66
20
|
|
67
21
|
data.Items.forEach(function(item) {//この部分で$.each(配列, function functionName() {})を使って書きたい。
|
68
22
|
|
@@ -89,18 +43,6 @@
|
|
89
43
|
$('.lists').append(template);
|
90
44
|
|
91
45
|
})
|
92
|
-
|
93
|
-
}).fail(function() {
|
94
|
-
|
95
|
-
$('.lists').html('<p class="message">データ通信ができませんでした<br>接続を確認してください。</p>');
|
96
|
-
|
97
|
-
});
|
98
|
-
|
99
|
-
});
|
100
|
-
|
101
|
-
});
|
102
|
-
|
103
|
-
</script>
|
104
46
|
|
105
47
|
```
|
106
48
|
|
@@ -139,383 +81,3 @@
|
|
139
81
|
```
|
140
82
|
|
141
83
|
という風に書いてみましたがうまく表示されませんでした。
|
142
|
-
|
143
|
-
### 補足情報(FW/ツールのバージョンなど)
|
144
|
-
|
145
|
-
```html
|
146
|
-
|
147
|
-
<!doctype html>
|
148
|
-
|
149
|
-
<html>
|
150
|
-
|
151
|
-
<head>
|
152
|
-
|
153
|
-
<meta charset="UTF-8">
|
154
|
-
|
155
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
156
|
-
|
157
|
-
<meta name="format-detection" content="telephone=no">
|
158
|
-
|
159
|
-
<title>jQuery</title>
|
160
|
-
|
161
|
-
<link rel="stylesheet" href="../../common/css/reset.css">
|
162
|
-
|
163
|
-
<link rel="stylesheet" href="../../common/css/base.css">
|
164
|
-
|
165
|
-
<link rel="stylesheet" href="./css/style.css">
|
166
|
-
|
167
|
-
</head>
|
168
|
-
|
169
|
-
<body>
|
170
|
-
|
171
|
-
<div class="wrap">
|
172
|
-
|
173
|
-
<div class="container">
|
174
|
-
|
175
|
-
<div class="header">
|
176
|
-
|
177
|
-
<p class="header__title">Search Books!</p>
|
178
|
-
|
179
|
-
</div>
|
180
|
-
|
181
|
-
<div class="search">
|
182
|
-
|
183
|
-
<div class="search__text">
|
184
|
-
|
185
|
-
<input type="text" class="search__text__input" placeholder="検索する" data-js="search-word">
|
186
|
-
|
187
|
-
</div>
|
188
|
-
|
189
|
-
<button class="search__btn" data-js="search-btn">検索する</button>
|
190
|
-
|
191
|
-
</div>
|
192
|
-
|
193
|
-
<div class="message"></div>
|
194
|
-
|
195
|
-
<ul class="lists"></ul>
|
196
|
-
|
197
|
-
</div>
|
198
|
-
|
199
|
-
</div>
|
200
|
-
|
201
|
-
<script src="../../common/js/jquery.js"></script>
|
202
|
-
|
203
|
-
<script src="./js/appid.js"></script>
|
204
|
-
|
205
|
-
</body>
|
206
|
-
|
207
|
-
</html>
|
208
|
-
|
209
|
-
```
|
210
|
-
|
211
|
-
```css
|
212
|
-
|
213
|
-
.clearfix::after {
|
214
|
-
|
215
|
-
display: block;
|
216
|
-
|
217
|
-
clear: both;
|
218
|
-
|
219
|
-
content: '';
|
220
|
-
|
221
|
-
}
|
222
|
-
|
223
|
-
.wrap {
|
224
|
-
|
225
|
-
padding-bottom: 40px;
|
226
|
-
|
227
|
-
}
|
228
|
-
|
229
|
-
.header {
|
230
|
-
|
231
|
-
width: 100%;
|
232
|
-
|
233
|
-
background-color: #43cee0;
|
234
|
-
|
235
|
-
}
|
236
|
-
|
237
|
-
.header__title {
|
238
|
-
|
239
|
-
line-height: 60px;
|
240
|
-
|
241
|
-
text-align: center;
|
242
|
-
|
243
|
-
font-size: 20px;
|
244
|
-
|
245
|
-
color: #fff;
|
246
|
-
|
247
|
-
}
|
248
|
-
|
249
|
-
.search {
|
250
|
-
|
251
|
-
overflow: hidden;
|
252
|
-
|
253
|
-
margin-bottom: 50px;
|
254
|
-
|
255
|
-
background: #fff;
|
256
|
-
|
257
|
-
box-shadow: 0 1px 5px #ccc;
|
258
|
-
|
259
|
-
}
|
260
|
-
|
261
|
-
.search__text {
|
262
|
-
|
263
|
-
width: 100%;
|
264
|
-
|
265
|
-
}
|
266
|
-
|
267
|
-
.search__text__input {
|
268
|
-
|
269
|
-
-webkit-box-sizing: border-box;
|
270
|
-
|
271
|
-
box-sizing: border-box;
|
272
|
-
|
273
|
-
width: 100%;
|
274
|
-
|
275
|
-
margin-bottom: 20px;
|
276
|
-
|
277
|
-
padding: 0 10px;
|
278
|
-
|
279
|
-
line-height: 3em;
|
280
|
-
|
281
|
-
border-top: none;
|
282
|
-
|
283
|
-
border-left: none;
|
284
|
-
|
285
|
-
border-right: none;
|
286
|
-
|
287
|
-
border-bottom: 1px solid #eee;
|
288
|
-
|
289
|
-
font-size: 20px;
|
290
|
-
|
291
|
-
}
|
292
|
-
|
293
|
-
.search__btn {
|
294
|
-
|
295
|
-
display: block;
|
296
|
-
|
297
|
-
margin: 0 auto 20px;
|
298
|
-
|
299
|
-
padding: 0 20px;
|
300
|
-
|
301
|
-
line-height: 40px;
|
302
|
-
|
303
|
-
border: none;
|
304
|
-
|
305
|
-
font-size: 18px;
|
306
|
-
|
307
|
-
color: #fff;
|
308
|
-
|
309
|
-
background-color: #43cee0;
|
310
|
-
|
311
|
-
cursor: pointer;
|
312
|
-
|
313
|
-
}
|
314
|
-
|
315
|
-
.search__btn:hover {
|
316
|
-
|
317
|
-
background-color: #1eabbd;
|
318
|
-
|
319
|
-
}
|
320
|
-
|
321
|
-
.lists {
|
322
|
-
|
323
|
-
overflow: hidden;
|
324
|
-
|
325
|
-
margin-left: 20px;
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
}
|
330
|
-
|
331
|
-
.lists__item {
|
332
|
-
|
333
|
-
-webkit-box-sizing: border-box;
|
334
|
-
|
335
|
-
box-sizing: border-box;
|
336
|
-
|
337
|
-
display: inline-block;
|
338
|
-
|
339
|
-
width: 25%;
|
340
|
-
|
341
|
-
padding: 0 20px 20px 0;
|
342
|
-
|
343
|
-
vertical-align: top;
|
344
|
-
|
345
|
-
text-align: center;
|
346
|
-
|
347
|
-
}
|
348
|
-
|
349
|
-
.lists__item__inner {
|
350
|
-
|
351
|
-
width: 100%;
|
352
|
-
|
353
|
-
max-width: 200px;
|
354
|
-
|
355
|
-
margin: 0 auto;
|
356
|
-
|
357
|
-
}
|
358
|
-
|
359
|
-
.lists__item__link {
|
360
|
-
|
361
|
-
display: block;
|
362
|
-
|
363
|
-
text-decoration: none;
|
364
|
-
|
365
|
-
}
|
366
|
-
|
367
|
-
.lists__item__img {
|
368
|
-
|
369
|
-
margin-bottom: 20px;
|
370
|
-
|
371
|
-
width: 100%;
|
372
|
-
|
373
|
-
max-width: 150px;
|
374
|
-
|
375
|
-
-webkit-box-shadow: 0 1px 5px #ccc;
|
376
|
-
|
377
|
-
box-shadow: 0 1px 5px #ccc;
|
378
|
-
|
379
|
-
}
|
380
|
-
|
381
|
-
.lists__item__detail {
|
382
|
-
|
383
|
-
margin-bottom: 10px;
|
384
|
-
|
385
|
-
padding-left: 5em;
|
386
|
-
|
387
|
-
text-indent: -5em;
|
388
|
-
|
389
|
-
line-height: 1.5em;
|
390
|
-
|
391
|
-
text-align: left;
|
392
|
-
|
393
|
-
font-size: 12px;
|
394
|
-
|
395
|
-
}
|
396
|
-
|
397
|
-
.message {
|
398
|
-
|
399
|
-
margin-bottom: 50px;
|
400
|
-
|
401
|
-
text-align: center;
|
402
|
-
|
403
|
-
}
|
404
|
-
|
405
|
-
.pager {
|
406
|
-
|
407
|
-
border-top: 1px solid #ccc;
|
408
|
-
|
409
|
-
padding-top: 35px;
|
410
|
-
|
411
|
-
}
|
412
|
-
|
413
|
-
.btn-wrapper {
|
414
|
-
|
415
|
-
display: flex;
|
416
|
-
|
417
|
-
justify-content: center;
|
418
|
-
|
419
|
-
margin-top: 20px;
|
420
|
-
|
421
|
-
}
|
422
|
-
|
423
|
-
.btn-item {
|
424
|
-
|
425
|
-
width: 80px;
|
426
|
-
|
427
|
-
height: 40px;
|
428
|
-
|
429
|
-
line-height: 40px;
|
430
|
-
|
431
|
-
box-sizing: border-box;
|
432
|
-
|
433
|
-
background-color: #43cee0;
|
434
|
-
|
435
|
-
color: #fff;
|
436
|
-
|
437
|
-
margin-left: 10px;
|
438
|
-
|
439
|
-
display: block;
|
440
|
-
|
441
|
-
font-size: 16px;
|
442
|
-
|
443
|
-
text-align: center;
|
444
|
-
|
445
|
-
}
|
446
|
-
|
447
|
-
.btn-item:hover:not(.disabled) {
|
448
|
-
|
449
|
-
background-color: #1eabbd;
|
450
|
-
|
451
|
-
}
|
452
|
-
|
453
|
-
.btn-item:first-child {
|
454
|
-
|
455
|
-
margin-left: 0;
|
456
|
-
|
457
|
-
}
|
458
|
-
|
459
|
-
.disabled {
|
460
|
-
|
461
|
-
background-color: #888;
|
462
|
-
|
463
|
-
}
|
464
|
-
|
465
|
-
.disabled.btn-item {
|
466
|
-
|
467
|
-
cursor: default;
|
468
|
-
|
469
|
-
}
|
470
|
-
|
471
|
-
.counter {
|
472
|
-
|
473
|
-
text-align: center;
|
474
|
-
|
475
|
-
font-size: 20px;
|
476
|
-
|
477
|
-
font-weight: bold;
|
478
|
-
|
479
|
-
}
|
480
|
-
|
481
|
-
.counter-current {
|
482
|
-
|
483
|
-
margin-right: 10px;
|
484
|
-
|
485
|
-
color: #43cee0;
|
486
|
-
|
487
|
-
}
|
488
|
-
|
489
|
-
.counter-all {
|
490
|
-
|
491
|
-
margin-left: 10px;
|
492
|
-
|
493
|
-
}
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
@media screen and (max-width: 767px) {
|
500
|
-
|
501
|
-
.lists__item {
|
502
|
-
|
503
|
-
width: 33.33%;
|
504
|
-
|
505
|
-
}
|
506
|
-
|
507
|
-
}
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
@media screen and (max-width: 479px) {
|
512
|
-
|
513
|
-
.lists__item {
|
514
|
-
|
515
|
-
width: 50%;
|
516
|
-
|
517
|
-
}
|
518
|
-
|
519
|
-
}
|
520
|
-
|
521
|
-
```
|
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -194,16 +194,6 @@
|
|
194
194
|
|
195
195
|
<ul class="lists"></ul>
|
196
196
|
|
197
|
-
<div class="pager" data-js="pager">
|
198
|
-
|
199
|
-
<div class="counter">
|
200
|
-
|
201
|
-
<span class="counter-current"></span>/<span class="counter-all"></span>
|
202
|
-
|
203
|
-
</div>
|
204
|
-
|
205
|
-
</div>
|
206
|
-
|
207
197
|
</div>
|
208
198
|
|
209
199
|
</div>
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -46,7 +46,7 @@
|
|
46
46
|
|
47
47
|
keyword: searchWord,
|
48
48
|
|
49
|
-
applicationId:
|
49
|
+
applicationId: "",
|
50
50
|
|
51
51
|
booksGenreId: '001',
|
52
52
|
|