質問編集履歴

2

説明文を訂正しました。

2016/06/19 09:02

投稿

uverworld101nm
uverworld101nm

スコア172

test CHANGED
File without changes
test CHANGED
@@ -8,11 +8,37 @@
8
8
 
9
9
  ```PHP
10
10
 
11
- var showResult = function(result){
11
+ var showResult = function(result){
12
12
 
13
13
  var res = '';
14
14
 
15
- if ( result.response.total_hit_count >
15
+ if ( result.response.total_hit_count > 0 ) {
16
+
17
+ var res = "";
18
+
19
+ for ( var i in result.response){
20
+
21
+ var r = result.response[i];
22
+
23
+ r = r.photo;
24
+
25
+ if(typeof r != 'undefined') {
26
+
27
+ if(typeof r.shop_name != undefined) res += r.shop_name + ':' + r.comment + '\n \n';
28
+
29
+ }
30
+
31
+ }
32
+
33
+ } else {
34
+
35
+ var res = '検索結果が見つかりませんでした。';
36
+
37
+ }
38
+
39
+ alert(res);
40
+
41
+ }
16
42
 
17
43
  ```
18
44
 

1

コードをのせました。

2016/06/19 09:02

投稿

uverworld101nm
uverworld101nm

スコア172

test CHANGED
File without changes
test CHANGED
@@ -15,3 +15,11 @@
15
15
  if ( result.response.total_hit_count >
16
16
 
17
17
  ```
18
+
19
+
20
+
21
+ ```php
22
+
23
+ $result=$response_$total_hit_count
24
+
25
+ ```