Questions tagged [yepnope]

yepnope is an asynchronous conditional JavaScript/CSS resource loader that allows you to load only the scripts that your users need.

yepnope is an asynchronous conditional JavaScript/CSS resource loader that allows you to load only the scripts that your users need.

134 questions
20
votes
1 answer

What is causing my scripts to be requested twice while using Modernizr.load (yepnope.js)

I am using yepnope.js to load javascript files dynamically,and I've noticed that my scripts appear to be loaded twice according to Firebug and Webkit Inspector. The problem is that in Firebug's Net panel (Firefox 4 latest), their response is a 200,…
Phil Ricketts
  • 8,236
  • 3
  • 28
  • 31
17
votes
2 answers

How to detect if Media Queries are present using Modernizr

I'm trying to detect whether media queries are present using Modernizr 2, then loading in respond.js if appropriate. I've put this in my script.js file... Modernizr.load({ test: Modernizr.mq, yep : '', nope: 'mylibs/respond.js' }); What am I…
SparrwHawk
  • 13,581
  • 22
  • 61
  • 91
15
votes
5 answers

How can I use yepnope.js with $(document).ready() effectively?

I have been implementing the yepnope script loader as part of the modernizr.js library. I have successfully got jQuery to load and jQuery dependent scripts afterwards. I am new to asynchronous loading of resources, so it's a bit new to me. I have…
Ash Clarke
  • 4,807
  • 1
  • 37
  • 48
9
votes
2 answers

Should I use Modernizrjs + YepNopejs + Requirejs in the same page?

I'm using RequireJs for structuring my JavaScript code. Also, I'm using a lot of CSS3 and I use "Modernizr w/ YepNope" + x number of css3 polyfills. I understand "Modernizr w/ YepNope" and RequireJs are both Resource Loaders. Since they are both…
Evan Larsen
  • 9,935
  • 4
  • 46
  • 60
7
votes
1 answer

How to load a conditional js file using modernizr now that yepnope is deprecated?

What are some good practices for loading a conditional javascript file using modernizr now that yepnope and .load are deprecated in the latest version of modernizr. Used to be able to use the .load…
MicFin
  • 2,431
  • 4
  • 32
  • 59
6
votes
1 answer

Modernizr - Which scripts get loaded asynchronously?

I have the following: Modernizr.load([ { load : '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js', complete : function () { if ( !window.jQuery ){ Modernizr.load('/js/jquery-1.6.2.min.js'); } } }, { load :…
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370
6
votes
1 answer

How would I (or should I) extend Modernizr.load() to preload images?

The idea is that the page /something/index.html is loaded. But, before I show it, its dependencies (css and images in this case) are preloaded. Modernizr.load({ load: ['/something/styles.css', '/something/image1.jpg'], complete: showFile …
nathanziarek
  • 619
  • 1
  • 6
  • 16
6
votes
2 answers

Modernizr.load Deprecated. Yepnope.js Deprecated. Now what?

Prior to Modernizr v3, I was using yepnope.js Modernizr.load and yepnope.js have both been deprecated. How do we conditionally call stylesheets or javascript files now? Example that worked with Modernizr v2.5.3: Modernizr.load({ test:…
scottrod
  • 477
  • 1
  • 8
  • 21
6
votes
2 answers

Multiple conditions with yepnope

I use yepnope.js as a resource loaded. I want to execute code in my JS module only when all the dependencies for that module have been loaded. I do not want to load JS dependencies that already been loaded. Suppose, I have dependencies D1.js and…
user1044169
  • 2,686
  • 6
  • 35
  • 64
6
votes
3 answers

How to check if an asynchronously loaded script has finished loading in javascript

Using javascript to asynchronously download another javascript file. I understand that this can be done by inserting a new script tag onto the page with the src attribute set to the file url. I also need to run some code when the script is finished…
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258
5
votes
1 answer

Alternatives to YepNope and LabJS

I am wanting to load javascript and css files via a resource loader. I was originally using LabJs but I found YepNope more elegant and easier to work with in my scenario. However I am finding it devastatingly slow, which is odd as apparently it is…
Grofit
  • 17,693
  • 24
  • 96
  • 176
5
votes
1 answer

Modernizr.load (yepnope.js) IE conditional confusion

In the following code dd_belatedpng.js is loading despite the fact that I'm using Firefox 4.0.1. According to the yepnope.js documentation, the ielt7! prefix should cause the script only to load if the browser is IE less than version 7. Is this…
tjm
  • 7,500
  • 2
  • 32
  • 53
5
votes
1 answer

Modernizr Yepnope Css Fallback

I'm using a CDN to Load Bootstrap.css. My question is how can i check if CDN bootstrap was loaded/found. And if it wasn't, then load local Boostrap. Here's Jquery fallback..