Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It seems like the browser conditionals:

  drupal_add_js(drupal_get_path('module', 'cufon') . '/js/cufon-drupal.js',
 array('group' => JS_THEME, 'browsers' => array('IE' => 'gte IE 9', '!IE' => TRUE), 
'weight' => 999, 'preprocess' => FALSE));

included in template.php (or a module) are not working due to the fact browsers option is supported for drupal_add_css() but not for drupal_add_js().

Can one state a not-hackish/patchy solution to exclude this file cufon-drupal.js on older browsers?

A solution like

<!--[if gte IE 9]>
<script src='<?php drupal_add_js(drupal_get_path('module', 'cufon') . '/js/cufon-drupal.js'); ?>'>

in html.tpl.php is not working.

share|improve this question
That second snippet doesn't need the drupal_add_js without it, would work – David Thomas Feb 2 '13 at 21:15

Seems like there is a non-drupal solution:

if(jQuery.browser.version.substring(0, 2) != "8.") { alert("not ie8"); }

It is not very handy as I have to paste inside the brackets the content of cufon-drupal.js content.

share|improve this answer
Rather than relying on user agent strings (which are inherently unreliable) it might be better to do this using feature detection/IE conditional comments. Have a look at this post for some ideas – Clive Mar 26 '12 at 12:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.