diff options
author | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-03-15 08:46:57 +0000 |
---|---|---|
committer | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-03-15 08:46:57 +0000 |
commit | 05c20c778190696c2f95e1a4f04bc51dafe811d1 (patch) | |
tree | a487923915b5160f645f95bd1b42ae88f7157c0d /includes | |
parent | 599fae437a3b2bfd9fb6790282a4fc1eaf2c2853 (diff) | |
download | brdo-05c20c778190696c2f95e1a4f04bc51dafe811d1.tar.gz brdo-05c20c778190696c2f95e1a4f04bc51dafe811d1.tar.bz2 |
#54002, Cached JS files break new drupal js error reporting behavior. Improved patch by chx
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc index ef000ecf5..c6fe6dd05 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1145,15 +1145,16 @@ function drupal_add_link($attributes) { * it adds "misc/drupal.js" to the output. Other scripts * depends on the 'killswitch' inside it. */ -function drupal_add_js($file) { +function drupal_add_js($file, $nocache = FALSE) { static $sent = array(); + $postfix = $nocache ? '?'. time() : ''; if (!isset($sent['misc/drupal.js'])) { - drupal_set_html_head('<script type="text/javascript" src="'. base_path() .'misc/drupal.js"></script>'); + drupal_set_html_head('<script type="text/javascript" src="'. base_path() .'misc/drupal.js'. $postfix .'"></script>'); $sent['misc/drupal.js'] = true; } if (!isset($sent[$file])) { - drupal_set_html_head('<script type="text/javascript" src="'. check_url(base_path() . $file) .'"></script>'); + drupal_set_html_head('<script type="text/javascript" src="'. check_url(base_path() . $file) . $postfix .'"></script>'); $sent[$file] = true; } } |