From 3b0567e6e98411be4b2f55d06d557be831738089 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 5 Jun 2016 07:26:39 +0300 Subject: like confirmation --- src/main/webapp/scripts.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/scripts.js b/src/main/webapp/scripts.js index bb3ddc5d..32427e1e 100644 --- a/src/main/webapp/scripts.js +++ b/src/main/webapp/scripts.js @@ -323,14 +323,16 @@ function openDialogLogin() { /******************************************************************************/ function likeMessage(e,mid) { - $.ajax({ - url: '//juick.com/like?mid='+mid, - type: 'POST' - }).done(function() { - $(e).closest("article").append("
OK!
"); - }).fail(function() { - $(e).closest("article").append("Ошибка
"); - }); + if (confirm("Are you sure?")) { + $.ajax({ + url: '//juick.com/like?mid='+mid, + type: 'POST' + }).done(function() { + $(e).closest("article").append("OK!
"); + }).fail(function() { + $(e).closest("article").append("Ошибка
"); + }); + } return false; } -- cgit v1.2.3