Javascript松散增强和全局导入

时间:2014-10-21 17:19:19

标签: javascript jquery

我尝试将松散增强与全局导入相结合,我无法使其工作,我理解(我认为)松散增强和全局导入的工作方式,但我如何将它们合二为一? 我想做的更多的是我想在匿名函数中使用jquery。

var zet = (function (z, $) {
    z.test = function(){
        console.log("test");
    }
    z.jqtest = function(classs){
        $("."+classs).css('backgaround','red');
    }
    return z;
}(zet || {}, jQuery));
zet.test(); 
zet.jqtest("a"); // this is the part at the bottom of the dom after it loaded, but not taking     effect and no error is shown, and yes i do have jquery loaded at the top of the dom    

帮助?

0 个答案:

没有答案