Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete Callback No Longer Global? #100

Closed
evanleck opened this issue Mar 2, 2012 · 8 comments
Closed

Complete Callback No Longer Global? #100

evanleck opened this issue Mar 2, 2012 · 8 comments

Comments

@evanleck
Copy link

evanleck commented Mar 2, 2012

In previous versions of YN, you could use a complete callback later down the page without loading any resources and it wouldn't fire until all of the scripts queued in YN were loaded. This was really handy for doing stuff like per-page jQuery plugin yanks or embedding a little bit of jQuery dependent script into a page. It seems however that newer versions have broken this functionality? For example:

<html>
  <head>
    <script src="yepnope-1.5.3.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
      yepnope('http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js');
    </script>
  <body>
    <p>This is my page</p>
    <script type="text/javascript" charset="utf-8">
      yepnope({
        complete: function() {
          jQuery(function($){
            $('body').append("<p>jQuery, why u no load?</p>");
          });
        }
      });
    </script>

That jQuery block doesn't execute and we get an uncaught reference error.

@SlexAxton
Copy link
Owner

It certainly seems like we can add this to the list of bugs that fixing other things about the complete callback added. We're working on fixing both sets of problems, but they seems to fight each other. Stay tuned for updates.

Thanks for the report. This is helpful for adding to our test suite.

@evanleck
Copy link
Author

evanleck commented Mar 2, 2012

Awesome, thank you!

@lencioni
Copy link

Duplicate? #96

@evanleck
Copy link
Author

@lencioni yeah, duplicate behavior definitely. Like that issue, I'm not sure what version this happened in either.

@tmikaeld
Copy link

tmikaeld commented Apr 1, 2012

Has this issue been fixed?

I just noticed it yesterday and it was just luck i found this issue reported, kind of have a site to launch and it depends on this function working.

Any one know what version of yepnope this still works with?

@evanleck
Copy link
Author

I'm not sure what version of yepnope it is, but the build included in Modernizr 2.0.6 works fine.

@evanleck
Copy link
Author

Just bumping this issue, it's still cropping up in Modernizr 2.6.1. Test code:

<html>
  <head>
    <script src="m.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
      Modernizr.load('http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
    </script>
  <body>
    <p>This is my page</p>
    <script>
      Modernizr.load({
        complete: function() {
          jQuery(function($){
            $('body').append("<p>jQuery, why u no load?</p>");
          });
        }
      });
    </script>

Where 'm.js' is built from http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexbox_legacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-input-inputtypes-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load

@ghost
Copy link

ghost commented Aug 11, 2012

Is there are news on how a fix for this is progressing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants