rem: alert('Invalid JSON response from server:\n' + resptext); 
add: handle_invalid_json(resptext); 
context:   ajaxPost(stdAjaxPrefix + '&_mode=addtag', 'tag=' + tag, function()    {      if ( ajax.readyState == 4 )      {        unsetAjaxLoading();        var nukeme = addtag_nukeme;        addtag_nukeme = false;        var resptext = String(ajax.responseText + ' ');        resptext = resptext.substr(0, resptext.length-1);        if ( resptext.substr(0, 1) != '{' )        {          alert('Invalid JSON response from server:\n' + resptext);          return false;        }        var json = parseJSON(resptext);        var parent = nukeme.parentNode;        parent.removeChild(nukeme);        addtag_open = false;        if ( json.success )        {          var node = parent.childNodes[1];          var insertafter = false;          var nukeafter = false;          if ( node.nodeValue == 'No tags on this page' )          {            nukeafter = true;          }          insertafter = parent.childNodes[ parent.childNodes.length - 3 ];          // these need to be inserted in reverse order          if ( json.can_del )          {            var a = document.createElement('a');            a.appendChild(document.createTextNode('[X]'));            a.href = '#';            a._js_tag_id = json.tag_id;            a.onclick = function() { ajaxDeleteTag(this, this._js_tag_id); return false; }            insertAfter(parent, a, insertafter);            insertAfter(parent, document.createTextNode(' '), insertafter);          }          insertAfter(parent, document.createTextNode(json.tag), insertafter);          if ( !nukeafter )          {            insertAfter(parent, document.createTextNode(', '), insertafter);          }          if ( nukeafter )          {            parent.removeChild(insertafter);          }        }        else        {          alert(json.error);        }      }    });
meta: 3765	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3765/d7141bbfd35c2b2bc6e3720f56cfebedaeb26b35/ajax.js/clean/includes/clientside/static/ajax.js