From 5835d99c7bafa77fc93dc777b9d9cd17912abfee Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 5 Mar 2012 14:21:24 +0530 Subject: [PATCH] add error if not being saved --- manifests/media/js/trans.js | 5 ++++- manifests/templates/trans.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/media/js/trans.js b/manifests/media/js/trans.js index 63d1403..f5e544a 100644 --- a/manifests/media/js/trans.js +++ b/manifests/media/js/trans.js @@ -17,9 +17,12 @@ $(function() { }; $(this).data("original", val); var url = trans.model == 'Translation' ? '/stringtranslate/' : '/dotrans/'; - $.post(url, data, function(response) { + var $post = $.post(url, data, function(response) { console.log(response); }, "json"); + $post.fail(function(err) { + alert("error saving translation. please check your internet connection and reload the page."); + }); // console.log(data); } }); diff --git a/manifests/templates/trans.html b/manifests/templates/trans.html index f424fa8..f873023 100644 --- a/manifests/templates/trans.html +++ b/manifests/templates/trans.html @@ -12,7 +12,7 @@ } - +