在页面加载时使用jQuery以编程方式单击链接 [英] Programmatically click on a link using jQuery on page load

查看:100
本文介绍了在页面加载时使用jQuery以编程方式单击链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面上有一个链接,我想在页面加载时以编程方式单击它.

I have a link that is on the page and I want to click it programmatically when the page loads.

类似这样的东西:

$(document).ready(function () {

   // code to make the page think $('a.tagcloud-link') is clicked
});

链接是一个AJAX调用,显示了Wordpress后端中的常用标签.

The link is an AJAX call that displays the popular tags in Wordpress backend.

该功能取决于许多因素,因此不容易对其进行编辑.

The function cannot easily be edited as it's dependent on many things.

所以我想触发AJAX链接,该链接在页面加载时调用最受欢迎的标签.

So I want to trigger the AJAX link that calls the most popular tags on page load.

这可以解决我所有的问题.

This will solve all my problems if it works.

该链接为$('a.tagcloud-link')

That link is $('a.tagcloud-link')

请,请帮我这个问题.我已经花了数小时努力尝试,但还是没有做到这一点.谢谢.

Please, please help me on this I've spent hours pulling my hair out trying and failing to do this. Thank you.

推荐答案

这些都无济于事. 我自己通过绕过链接并在加载时执行它来修复它.

None of these helped. I fixed it myself by bypassing the link and executing it on load.

这篇关于在页面加载时使用jQuery以编程方式单击链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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