js模拟a标签以tab页打开新页面的方法
摘要:
坑爹jquery,不能用简单的click()方法触发,换回原生js吧:第一种方法:var comment = document.getElementsByTagName('a')[0]; if (document.all) { // For IE comment.click(); } else if (document.createEvent) { //FOR DOM2 var ev = document.createEvent('MouseEvents'); ev.initEvent('click'... 阅读全文
posted @ 2013-11-21 16:12 前端屌丝 阅读(1070) 评论(0) 推荐(0) 编辑