jquery trigger伪造a标签的click事件取代window.open方法
varohtml='<divclass="friend-dialogtacpt15pb20">'+
'<divclass="f-h32">您已经成功发送好友申请。</div>'+
'<pclass="c999">上传真实头像,好友申请更容易被通过哦,赶紧上传头像吧!</p>'+
'<ahref="<%=path%>/teacher/editUserAvatar.action"target="_blank"><spanid="awindowopen"></span></a>'+
'</div>';
$.dialog({
lock:true,
title:'温馨提示',
button:[
{value:'点击上传图像',callback:function(){
$("#awindowopen").trigger("click");
},focus:true
}
],
content:ohtml
});
varohtml='<divclass="friend-dialogtacpt15pb20">'+
'<divclass="f-h32">您已经成功发送好友申请。</div>'+
'<pclass="c999">上传真实头像,好友申请更容易被通过哦,赶紧上传头像吧!</p>'+
'<ahref="<%=path%>/teacher/editUserAvatar.action"target="_blank"><spanid="awindowopen"></span></a>'+
'</div>';
$.dialog({
lock:true,
title:'温馨提示',
button:[
{value:'点击上传图像',callback:function(){
$("#awindowopen").trigger("click");
},focus:true
}
],
content:ohtml
});
需要注意的是:
在这个地方:
<ahref="<%=path%>/teacher/editUserAvatar.action"target="_blank"><spanid="awindowopen"></span></a> <ahref="<%=path%>/teacher/editUserAvatar.action"target="_blank"><spanid="awindowopen"></span></a> <a>标签内一定要有内容,并且要模拟里面的内容被点击而不是<a></a>被点击
热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短