触发点击jQuery不起作用 [英] Trigger click jquery not working

查看:86
本文介绍了触发点击jQuery不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在弄清楚为什么这个简单的脚本不起作用:

I'm figuring out why this simple script is not working:

jQuery.noConflict();
jQuery(document).ready(function() {
    jQuery('.next_button a').trigger('click');
});

noConflict是必需的,因为我也在此页面中加载了原型/脚本.

noConflict is necessary because I also load prototype/scriptaculous in this page.

如果我将.trigger('click')替换为另一个功能(例如:.css(...),则效果很好.只有触发似乎中断了.

If I replace .trigger('click') with another function (es: .css(...) this works well. Only triggering seems to go broken.

推荐答案

Stevanicus的答案.

How can I simulate an anchor click via jquery? Check this link and see this answer by Stevanicus.

$('a#swaswararedirectlink')[0].click();

这篇关于触发点击jQuery不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆