We are using AJAX load in combination with editablefields module to allow quick editing of fields for our admins.

The AJAX load module adds the JS file (ajax_load.js) to the site regardless of usage. In our scenario AJAX Load is only ever required for logged in admins but anonymous users are also being served the ajax_load.js file which is unnecessary.

To reduce overhead on this site, I've modified the module to include the following check:

  if (user_access('administer nodes')) {
    drupal_add_js(drupal_get_path('module', 'ajax_load') .'/ajax_load.js');
  }

It would be much better if we could either specify paths similar to the lightbox2 module or if AJAX Load had it's own user access permission.

Comments

karljohann’s picture

Brilliant. I also agree having its own permission is the way to go.