includes/clientside/static/autocomplete.js
changeset 174 d74ff822acc9
parent 73 0a74676a2f2f
child 212 d57af0b0302e
equal deleted inserted replaced
173:91127e62f38f 174:d74ff822acc9
   158         id = 'usernamehoverobj_' + Math.floor(Math.random() * 10000000);
   158         id = 'usernamehoverobj_' + Math.floor(Math.random() * 10000000);
   159         unObjDivCurrentId = id;
   159         unObjDivCurrentId = id;
   160         thediv.id = id;
   160         thediv.id = id;
   161         unObj.onblur = function() { destroyUsernameDropdowns(); }
   161         unObj.onblur = function() { destroyUsernameDropdowns(); }
   162         
   162         
   163         eval(ajax.responseText);
   163         var response = String(ajax.responseText) + ' ';
       
   164         if ( response.substr(0,1) != '{' )
       
   165         {
       
   166           new messagebox(MB_OK|MB_ICONSTOP, 'Invalid response', 'Invalid or unexpected JSON response from server:<pre>' + ajax.responseText + '</pre>');
       
   167           return false;
       
   168         }
       
   169         
       
   170         response = parseJSON(response);
       
   171         var errorstring = false;
       
   172         if ( response.mode == 'error' )
       
   173         {
       
   174           errorstring = response.error;
       
   175         }
       
   176         else
       
   177         {
       
   178           var userlist = response.users_real;
       
   179         }
       
   180         
   164         if(errorstring)
   181         if(errorstring)
   165         {
   182         {
   166           html = '<span style="color: #555; padding: 4px;">'+errorstring+'</span>';
   183           html = '<span style="color: #555; padding: 4px;">'+errorstring+'</span>';
   167         }
   184         }
   168         else
   185         else