easyui中选择器获取对象和直接引用的对象的区别是什么?

 var resDlg;
 $(function(){
    initResDlg();
});
 function initResDlg(){
    resDlg = $('#resDlg').dialog({
        title:'创建双随机检查',

        width:600,
        height:400,
        closed:true,
        buttons: [{
            text:'确定',
            iconCls:'icon-ok',
            handler:addRes
        },{
            text:'取消',
            handler:closeRes
        }]
    });
}
    $('#resDlg').dialog({
        href:'../random/addResTo.do',
    }).dialog('open');
     resDlg.dialog({
        href:'../random/addResTo.do',
    }).dialog('open');

图片说明
图片说明

你的resDlg 存储的是jquery对象,并不是dialog的实例,$('#xxx').dialog这种方式的话会新生成一个jquery对象,然后easyui会获取dialog的实例,实际效果一样。只是$('#xxx')会新生成一耳光jquery对象,多这个步骤