requirejs.config({//baseUrl:'js/lib',path:{jquery:'jquery'}})requirejs(['jquery'],function($){// con
requirejs.config({ //baseUrl:'js/lib', path:{ jquery:'jquery' }})requirejs(['jquery'],function($){ // console.log($) function Helloword(el,opts){ this.opts = $.extend({},Helloword.DEFAULTS,opts); this.el = $(el); } Helloword.DEFAULTS = { name:'xiaiang', age:18+ '岁', address:'惠州' } Helloword.prototype.name = function(){ var opts = this.opts; console.log(opts.name); } Helloword.prototype.age = function(){ var opts = this.opts; var $el =this.$el; console.log(opts.name); } new Helloword().name(); new Helloword().age($('.test'),{ name:'mei', age:16+ '岁', address:'惠州2' });})