给按钮添加class名open-contact-dialog
<a href="javascript:void(0)" class="open-contact-dialog">咨询购买</a>
点击按钮判断窗口是否存在,若存在就执行点击事件
$('.open-contact-dialog').click(function(){
if($('#nb_invite_ok').length > 0){
$('#nb_invite_ok').click()
}
})