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

后端 未结 5 1744
刺人心
刺人心 2020-12-23 23:01

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

5条回答
  •  感动是毒
    2020-12-23 23:56

    I think that Alex Sexton solution would be correct :

    yepnope({
        load: '//ajax.googleapisOFFLINE.com/ajaxX/libs/jquery/1.7.1/jquery.min.js',
        callback: function () {
            if (!window.jQuery) {
                yepnope('/js/jquery-1.7.1.min.js');
            }
        },
        complete: function () {
          $(function(){
            $("div.whatever").css("color","red");
          });
        }
    });
    

提交回复
热议问题