Browse Source

debug console message added if callback function in ajaxCall() fkt. is invalid

T. Meissner 7 years ago
parent
commit
a35855609a
1 changed files with 8 additions and 7 deletions
  1. 8
    7
      scripts/gcf.js

+ 8
- 7
scripts/gcf.js View File

@@ -1,10 +1,9 @@
1
-/**
2
- * Created with JetBrains WebStorm.
3
- * User: torsten
4
- * Date: 28.03.13
5
- * Time: 23:07
6
- * To change this template use File | Settings | File Templates.
7
- */
1
+// variable to en-/disable debug
2
+// set to 1 to enable debug log
3
+if (DEBUG === undefined) {
4
+    var DEBUG;
5
+}
6
+
8 7
 
9 8
 
10 9
 var gcf = {
@@ -98,6 +97,8 @@ var gcf = {
98 97
                 // check if callback is a function
99 98
                 if(typeof callback === "function") {
100 99
                     callback(response);
100
+                } else {
101
+                    if (DEBUG === 1) {console.log(callback + " is no callback function");}
101 102
                 }
102 103
             }
103 104
         };