[drupal-devel] [feature] Ajax HTTPPost javascript function

Robert Douglass rob at robshouse.net
Fri May 27 21:44:20 UTC 2005


Nice functionality. Question about coding conventions; I assume that 
Drupal coding conventions apply to our js code as well? If so, I believe 
one should avoid the use of conditional statements that depend on the 
"line after" rule and use {} in all cases. I find this block especially 
disturbing to read:

+    if (callback_function)
+      xmlhttp.onreadystatechange = function() {
+        if (xmlhttp.readyState == 4)
+          callback_function(xmlhttp.responseText, xmlhttp, 
callback_parameter)
+      }

To me these are just accidents waiting to happen (with the brackets).

-Robert



More information about the drupal-devel mailing list