diff --git a/public/map.htm b/public/map.htm index 07ca0f3..4d44bbd 100644 --- a/public/map.htm +++ b/public/map.htm @@ -1,4 +1,4 @@ - + @@ -14,20 +14,32 @@ $(function () { $("#dialog").dialog( { - autoOpen: false, - width: 600, - modal: true, - show: { - effect: "blind", - duration: 500 - }, - hide: { - effect: "explode", - duration: 500 - } - } - ); - }); + autoOpen: false, + width: 600, + modal: true, + show: { + effect: "blind", + duration: 500 + }, + hide: { + effect: "explode", + duration: 500 + }, + buttons: { + "Добавить точку": function () { + + addNewPoint(); + + $(this).dialog("close"); + }, + + "Закрыть": function () { + + $(this).dialog("close"); + } + } + }); + }); function addNewPoint() { @@ -44,25 +56,32 @@ // /json/categories / addpoint - $.getJSON( - "/json/addpoint", + $.ajax({ + type: 'POST', + + url: "http://wikipoints.ru/json/addpoint", - responsQuerry, + data: responsQuerry, - function (data) { + dataType: 'json', + + success: function (data) { alert('ok' + data); //curentObj.Id = data; - }).error(function (XMLHttpRequest, textStatus, errorThrown) { + }, + + error: function (XMLHttpRequest, textStatus, errorThrown) { alert("Ошибка - " + XMLHttpRequest.responseText); - }); + } + }); } function openAddDlg() { - + myMap.balloon.close(); - + $('#dialog').dialog('open'); } @@ -137,7 +156,6 @@ Источник:

-