From: Manuel Penschuck Date: Mon, 16 Feb 2015 14:55:25 +0000 (+0100) Subject: Proper treatment of empty response string X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=2d0d1bf9ba25b4f5975e70a50f6f4ed9af30ab53;p=daqtools.git Proper treatment of empty response string --- diff --git a/web/htdocs/scripts/cts.js b/web/htdocs/scripts/cts.js index 3f000a8..5bb59aa 100644 --- a/web/htdocs/scripts/cts.js +++ b/web/htdocs/scripts/cts.js @@ -128,8 +128,9 @@ var CTS = new Class({ writeRegisters: function(values) { var arrValues = []; Object.each(values, function(v,r) {arrValues.push(r); arrValues.push(v)}); + var myUrl = '/cts/cts.pl?write,' + encodeURIComponent( arrValues.join(',') ); (new Request.JSON({ - url: '/cts/cts.pl?write,' + arrValues.join(','), + url: myUrl, onSuccess: function(json, text) { if (!json) { var m = text.match(/
(.*)<\/pre>/i);
@@ -806,11 +807,11 @@ function timestamp2Date(ts) {
    
 
 function requestFailure(obj){
-   console.debug(obj);
+   if (console) console.debug(obj);
+  
    var text = String((typeof(obj) == 'string') ? obj : obj.responseText);
    var m = text.match(/
([\s\S]*)<\/pre>/im);
    
-   
    if (obj.responseText && m) {
       text = m[1];
       m = text.match(/^\s*-+ More[\w\s]+ -+\s+(.+)$/im)