首页 新闻 会员 周边

js 老是提示为空或不是对象

0
[待解决问题]

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);
},

 

提取了一小段代码 我都判断了 怎么还报错 ,

询问java1的主页 询问java1 | 初学一级 | 园豆:72
提问于:2013-12-31 16:31
< >
分享
所有回答(1)
0
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);
    }
};
飞扬的尘埃 | 园豆:1318 (小虾三级) | 2013-12-31 17:56
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册