From 4fbad9b6ada9890cbf87c3570e8f1335226ab87e Mon Sep 17 00:00:00 2001 From: Banana Date: Sat, 13 Aug 2011 11:34:15 +0200 Subject: [PATCH] error function on error --- javascript/mif-tree/mif.tree_for-mt-1.3.2.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/javascript/mif-tree/mif.tree_for-mt-1.3.2.js b/javascript/mif-tree/mif.tree_for-mt-1.3.2.js index a02e8e4..16515ce 100644 --- a/javascript/mif-tree/mif.tree_for-mt-1.3.2.js +++ b/javascript/mif-tree/mif.tree_for-mt-1.3.2.js @@ -1001,8 +1001,16 @@ Mif.Tree.implement({ isSuccess: Function.from(true), secure: true, onSuccess: success, + onError: errorFunc, method: 'get' }, this.loadOptions()), options); + + function errorFunc(text,error) { + alert(text); + alert(error); + return false; + } + if(options.json) return success(options.json); new Request.JSON(options).send(); return this; @@ -1031,8 +1039,16 @@ Mif.Tree.Node.implement({ isSuccess: Function.from(true), secure: true, onSuccess: success, + onError: errorFunc, method: 'get' }, this.tree.loadOptions(this)), this.loadOptions), options); + + function errorFunc(text,error) { + alert(text); + alert(error); + return false; + } + if(options.json) return success(options.json); new Request.JSON(options).send(); return this; -- 2.39.5