js文件的创建:
/**
* Created by Administrator on 2018/7/14.
*/
(function(arg){
var status = 1;
$.extend({
'wanseng':function () {
return 'sb';
}
});
})(jQuery);
文件的调用:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <script src="../jquery-2.12.4.js"></script> <script src="plugin1.js"></script> <script> var v = $.wanseng(); alert(v) </script> </body> </html>
创建文件的两种方式
1.$.extend({
})
2.
$.fn.extend({
})