javascript - zepto 错误
index.html
1 2 3 4 5 6 7 8 9 | <code><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>
</code>
|
script.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | <code> var hsh = ( function ($){
return {
init: function (){
$.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" );
},
home: function (){
alert( "home" );
}
}
})(Zepto);
</code>
|
FireBug 报错
TypeError: $.ajaxSetting is not a function
alert("init");
也没执行!
不知道 这种方式的 zepto 应该怎么写! 求大神指教! -_-|||