Allow conditional scripts in addition to conditional stylesheets

chellman - June 30, 2009 - 20:21
Project:Zen
Version:6.x-2.x-dev
Component:IE Problems
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Just like it says. I'd like to be able to use a conditional-scripts[if ie] kind of notation in the .info file to add conditional javascript files for IE. I've been looking at the conditional_styles module, even hacked it up to try and implement this, but so far I'm not getting anywhere with it.

I'm attaching the hacked up version of conditional_styles in case it's any help. It's not working for me so far, and I'm hoping it's more to do with some small thing being missing than the modified code being utterly useless.

AttachmentSize
conditional_scripts.zip10.03 KB

#1

rancky - July 9, 2009 - 09:38
Title:Allow conditional scripts in addition to conditional stylesheets» Javascript is the solution

Hello,
I also need this feature which unfortunately does not exist in Zen theme.

The solution I found is to insert the script in the standard way (non-conditional) and to test the browser version inside the script.

I hope Zen will have this function in a future version.

#2

chellman - July 9, 2009 - 14:57
Title:Javascript is the solution» Allow conditional scripts in addition to conditional stylesheets

Reverting the issue title.

#3

guix - July 30, 2009 - 00:47

I'd be interested with that... the problem is the order of the scripts...

#4

appellation - October 16, 2009 - 18:57

I'm interested too. This would be useful for employing techniques such as those inspired by the suckerfish technique, which need only include the javascript if the browsers is IE.

#5

SeanBannister - October 7, 2009 - 13:12

Just tried to do exactly this and realized it doesn't work. Looking forward to this feature. Sub

 
 

Drupal is a registered trademark of Dries Buytaert.