var common1 = {
content:'提示内容',
hint:'提示',
};
var typeMethod = {
method:function(common,common1,type){
if(common==null){
$.ligerDialog.alert(common1.content,common1.hint,type);
}
if(common.content==null && common.hint!=null){
$.ligerDialog.alert(common1.content,common.hint,type);
}
if(common.hint==null && common.content!=null){
$.ligerDialog.alert(common.content,common1.hint,type);
}
$.ligerDialog.alert(common.content,common.hint,type);
},
提取了一小段代码 我都判断了 怎么还报错 ,
var common1 = { content: '提示内容', hint: '提示', }; var typeMethod = { method: function (common, common1, type) { if (!common) { $.ligerDialog.alert(common1.content, common1.hint, type); return; } if (!common.content && common.hint) { $.ligerDialog.alert(common1.content, common.hint, type); return; } if (!common.hint && common.content) { $.ligerDialog.alert(common.content, common1.hint, type); return; } $.ligerDialog.alert(common.content, common.hint, type); } };