Force css refresh interferes with JQuery .css property use

jshuell - April 5, 2008 - 03:17
Project:Super Nav
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

If you want to use the CSS and JS refresh functionality there are some issues with it globally replacing all strings that contain .css with a timestamped .css?= to fool the browser into thinking it should download the file. This seems to work on stylesheet definitions but if you use the JQuery.css property or method in your page then it will replace those to. An example: I have a function that loads into the page that increases and decreases the font size of the content area:

$('.content .node-text').css("font-size",size+"%");

After using the force css and js refresh functionality, my JS is changed to:

$('.content .node-text').css?=1207363711("font-size",size+"%");

The simplest workaround at this point is to move these functions out of the page and into an included file. Not possible in my case, but should work in most. Can we add a a check to make sure the .css is in a stylesheet definition before replacing? If I get a chance I'll make a patch.

#1

chrisshattuck - April 24, 2008 - 23:14

Hello jshuell,

I have added a check for this in the latest Drupal 5 dev version.

Thanks for the tip!
Chris

#2

chrisshattuck - April 24, 2008 - 23:14
Status:active» fixed

#3

Anonymous (not verified) - May 8, 2008 - 23:21
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.