Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I hope you've figured this out already, but in case you haven't:</p> <p>You're attempting to run a JS statement as an item in an array. That won't work in any JS context that I know of. The first step I tried was to remove the jQuery call, and specify the raw URL to the CSS instead, like this:</p> <pre><code>yepnope({ test: Modernizr.fontface, yep: [ 'http://fonts.googleapis.com/css?family=Bitter:400,700|Oswald:300,400,700' ] }); </code></pre> <p>This loads the stylesheet, but throws an error because YepNope thinks it's a JS file. The fix for this is to include the YepNope CSS prefix plugin (you can find it in the Github repo <a href="https://github.com/SlexAxton/yepnope.js/blob/master/prefixes/yepnope.css-prefix.js" rel="nofollow">here</a>). Then you can do this:</p> <pre><code>yepnope({ test: Modernizr.fontface, yep: [ 'css!//fonts.googleapis.com/css?family=Bitter:400,700|Oswald:300,400,700' ] }); </code></pre> <p>I've tested, and it works great.</p> <p>You can also use this method with Modernizr.load (if you're using a custom build of Modernizr). All you have to do is include any YepNope plugins after you include Modernizr. It's smart enough to delegate the appropriate calls to YepNope.</p> <p>As a side note, notice I removed the "http:" from the second code block. This is called a "protocol relative URL". It allows the loading to occur based on your current protocol. That means it will load "<strong>http</strong>://fonts.googleapis..." if you're on an insecure domain, and load "<strong>https</strong>://fonts.googleapis..." if on a secure domain.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload