Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

css3-mediaqueries.js

nickffnickff Member
in Important News edited May 2013
Hey Ya'll,

I'm looking to use the popular css3-mediaqueries.js script for media query compatibility back to old IE versions on my checkout page. Unfortunately, when I go to cache my checkout page with that script included, I'm getting some errors. It seems to be dying at line 71 of the script:
var _3={BLOCKS:/[^\s{][^{]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;)/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g};

I'm guessing it has something to do with that @import bit, but this syntax makes my eyes go blurry.

Has anyone had success incorporating this script into their checkout pages? If so, any tips?
Comments
  • nickffnickff Member
    Sorry, this was a result of modernizr.js, not css3-mediaqueries.js. I switched from a local version of modernizr to a CDN URL and now all is well. False alarm!
  • fc_adamfc_adam FoxyCart Team
    @nickff,

    Glad you got it sorted. There is a known little issue with modernizr that it has some minified code that looks like a twig tag, and it breaks our Twig engine. Wrapping the javascript include in Twig raw tags fixes it:
    {% raw %}
    // your javascript include
    {% endraw %}
    
Sign In or Register to comment.