Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function callback(results, status) {
- var attractions = $("#attractions");
- if (status == google.maps.places.PlacesServiceStatus.OK) {
- for (var i = 0; i < results.length; i++) {
- places = results;
- var place = results[i];
- createMarker(place);
- attractions.append("<ul style='display: block' id='" + i + "'>" + place.name + "</ul>");
- if (place.hasOwnProperty('photos') && place.photos.length > 0) {
- attractions.children(":last").append("<li> <img src='" + place.photos[0].getUrl({
- 'maxWidth': 75,
- 'maxHeight': 50
- }) + "'/>" + "</li>");
- attractions.children(":last").find('li').toggle();
- }
- $.ajax({
- type: "POST",
- url: "/api/attraction",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- data: JSON.stringify({
- attraction: {
- "name":"cos",
- "cost": 1.23
- }
- }),
- success: function () {
- console.log(attraction.cost + attractions.name);
- },
- error: function () {
- console.log("Error during POST");
- }
- });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement