diff --git a/javascript_libraries.module b/javascript_libraries.module
index 3e8b0a5..c175acd 100644
--- a/javascript_libraries.module
+++ b/javascript_libraries.module
@@ -213,7 +213,7 @@ function javascript_libraries_init() {
  * Helper function that calls drupal_add_js().
  */
 function javascript_libraries_add_js($library, $options = array()) {
-  // Add a variable offset so use-added scripts come after theme scripts.
+  // Add a variable offset so user-added scripts come after theme scripts.
   $offset = variable_get('javascript_libraries_custom_weight_offset', 100);
   // Test taken from drupal_get_js() for whether we are preprocessing.
   $preprocess_js = (variable_get('preprocess_js', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));
@@ -346,13 +346,46 @@ function javascript_libraries_block_view_alter(&$data, $block) {
       $library = javascript_libraries_custom_load($id);
       // Only libraries that are not otherwise loaded will be loaded for this block.
       if (!empty($library) && $library['scope'] == 'disabled') {
-        javascript_libraries_add_js($library, $options);
+        // Use a script loader inline to avoid breaking block cache, since
+        // drupal_add_js() won't run when the cached version is served.
+        $inline = javascript_libraries_add_inline(file_create_url($library['uri']));
+        // Use #suffix if content is a renderable array; otherwise append the
+        // output string.
+        if (is_array($data['content'])) {
+          $data['content']['#suffix'] = $inline;
+        }
+        elseif (is_string($data['content'])) {
+          $data['content'] .= $inline;
+        }
       }
     }
   }
 }
 
 /**
+ * Add script loader inline to attach a script to markup that will be cached.
+ *
+ * @param $url
+ *   URL of the script to be loaded.
+ * @return string
+ *   Inline javascript to load the script.
+ */
+function javascript_libraries_add_inline($url) {
+  $script = <<<ENDSCRIPT
+<script type="text/javascript">
+  jQuery(document).ready(function () {
+    Drupal.settings.javascript_libraries = Drupal.settings.javascript_libraries || {};
+    if (!Drupal.settings.javascript_libraries["$url"]) {
+      jQuery(document).ready(function() { jQuery.getScript("$url"); });
+      Drupal.settings.javascript_libraries["$url"] = true;
+    }
+  });
+</script>
+ENDSCRIPT;
+  return $script;
+}
+
+/**
  * Implements hook_form_FORM_ID_alter().
  */
 function javascript_libraries_form_block_admin_configure_alter(&$form, &$form_state) {
