为什么无法执行getsetting函数呢?总提示is not a function
;(function($){
// alert($);
var House = function(obj){
//先保存一下obj对象,方便内部调用
this.obj = obj;
this.set = {
"width":1000,
"height":800,
"posterWidth":700,
"posterHeight":800,
"speed":500,
"scale":0.9,
"verticalAlign":"middle"
};
$.extend(this.set,{"width":500});
//$.parseJSON(this.set,);
// console.log(this.set);
console.log(this.getSetting());
};
House.method = {
//用于获取处理用户在标签的配置
getSetting:function(){
var setting = this.obj.attr('data-set');
if(setting && setting!=null){
return($.parseJSON(setting));
}else{
return {};
}
}
};