zepto 错误

index.html

<script src="//cdn.staticfile.org/zepto/1.1.4/zepto.min.js"></script>
<script src="./assets/js/script.js"></script>
<script>
    $(function(){
        hsh.home();
        hsh.init();
    });
</script>

script.js

var hsh = (function($){

    return {

        init: function(){

            //ajax 默认设置
            $.ajaxSetting({

                type: "post",
                url: apiUrl,
                dataType : "json",
                async: true,
                error: function(xhr, errorType, error){

                },
                beforeSend: function(xhr, setting){

                },
                success: function(data, status, xhr){

                },
                complete: function(xhr, status){

                }
            });

            alert("init");
            //init.End
        },

        home: function(){

            alert("home");
        }
    }

})(Zepto);

FireBug 报错

TypeError: $.ajaxSetting is not a function

alert("init"); 也没执行!

不知道 这种方式的 zepto 应该怎么写! 求大神指教! -_-|||

阅读 6.6k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题