質問編集履歴
1
修正したソース追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -155,3 +155,47 @@
|
|
155
155
|
document.getElementById('result').innerHTML = errorMessage
|
156
156
|
|
157
157
|
```
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
【修正後ソース(JQuery)】
|
162
|
+
|
163
|
+
```
|
164
|
+
|
165
|
+
$.ajax
|
166
|
+
|
167
|
+
type: 'GET'
|
168
|
+
|
169
|
+
url: '/near'
|
170
|
+
|
171
|
+
data:
|
172
|
+
|
173
|
+
lat: lat
|
174
|
+
|
175
|
+
lng: lng
|
176
|
+
|
177
|
+
success:(data, textStatus, jqXHR) ->
|
178
|
+
|
179
|
+
htmltext = "<ul class='slide_selector'>"
|
180
|
+
|
181
|
+
for i in [0..4]
|
182
|
+
|
183
|
+
htmltext += "<li class='post clip'><a href ='/" + gon.locale + "/restaurant/" + data[i].id + "'>"
|
184
|
+
|
185
|
+
htmltext += "<img alt='" + data[i].restaurantname + "' src='" + gon.image + data[i].image1 + "' />"
|
186
|
+
|
187
|
+
htmltext += "<ul class='note'><li class='name'>" + data[i].restaurantname + " </li><li class='sta'>" + data[i].station_id + "</li></ul></a></li>"
|
188
|
+
|
189
|
+
htmltext += "</ul></div>"
|
190
|
+
|
191
|
+
$('#restaurant').html htmltext
|
192
|
+
|
193
|
+
return
|
194
|
+
|
195
|
+
error:(jqXHR, textStatus, errorThrown) ->
|
196
|
+
|
197
|
+
$('#result').html 'got error' + textStatus
|
198
|
+
|
199
|
+
return
|
200
|
+
|
201
|
+
```
|