html5中文学习网

您的位置: 首页 > 网站及特效实例 > javascript特效 » 正文

jquery trigger伪造a标签的click事件取代window.open方法_jquery_

[ ] 已经帮助:人解决问题
var ohtml='<div class="friend-dialog tac pt15 pb20">'+ '<div class="f-h32">您已经成功发送好友申请。</div>'+ ' <p class="c999">上传真实头像,好友申请更容易被通过哦,赶紧上传头像吧!</p> '+ '<a href="<%=path%>/teacher/editUserAvatar.action" target="_blank"><span id="awindowopen" ></span></a>'+ ' </div>'; $.dialog({ lock:true, title: '温馨提示', button: [ {value: '点击上传图像',callback: function () { $("#awindowopen").trigger("click"); },focus: true } ], content:ohtml }); var ohtml='<div class="friend-dialog tac pt15 pb20">'+'<div class="f-h32">您已经成功发送好友申请。</div>'+' <p class="c999">上传真实头像,好友申请更容易被通过哦,赶紧上传头像吧!</p> '+'<a href="<%=path%>/teacher/editUserAvatar.action" target="_blank"><span id="awindowopen" ></span></a>'+' </div>';$.dialog({lock:true,title: '温馨提示',button: [{value: '点击上传图像',callback: function () {$("#awindowopen").trigger("click");},focus: true}],content:ohtml}); 

ajUHTML5中文学习网 - HTML5先行者学习网
需要注意的是:ajUHTML5中文学习网 - HTML5先行者学习网

在这个地方:ajUHTML5中文学习网 - HTML5先行者学习网
ajUHTML5中文学习网 - HTML5先行者学习网

<a href="<%=path%>/teacher/editUserAvatar.action" target="_blank"><span id="awindowopen" ></span></a> <a href="<%=path%>/teacher/editUserAvatar.action" target="_blank"><span id="awindowopen" ></span></a><a>标签内一定要有内容,并且要模拟里面的内容被点击而不是<a></a>被点击
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助