1

I'm using yepnope to load jquery, and a bunch of plugins.

I fix the onready "problem" using:

var docready=[],$=function(){return{ready:function(fn){docready.push(fn)}}};

yepnope({
  load:["../css/plugins/jquery-1.8.2.min.js"],
  complete: function () {


    $ = jQuery;
    jQuery(document).ready(function() {
        for(n in docready) docready[n]();
    });

            $(document).ready(function(){ jsLoadingALotofPlugins() });  
  } })

But in some pages I need to load some plugins normally using script tags:

<script src="../css/anotherjQueryPlugin.js" type="text/javascript" ></script>

And I get the error:

TypeError: $ is undefined
$.fn.player = function(method){...

If i use yepnope on load this js i know it will work, but i need to use script tag, Is there any workaround to fix this like i did with onready??

4

0 に答える 0