jquery - (function($){$.alert = {confirm : function (

查看:77
本文介绍了jquery - (function($){$.alert = {confirm : function (的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

(function($){$.alert = {confirm : function (option){xxx})}})(Zepto);
1.这种写法什么意思?
2.$.alert 这里表示什么?

解决方案

贴代码注意排版:格式化你的代码如下,原来里面还多了个); ps:你代码里写的是zepto,标签给的却是jQuery- -

(function($){
    $.alert = {
        confirm : function (option){
            //xxx
        }
     };
 })(Zepto);

如果这么写,能看明白么?

var fn = function($){
    $.alert = {
        confirm : function (option){
            //xxx
        }
    };
};
fn(Zepto);

这篇关于jquery - (function($){$.alert = {confirm : function (的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆