在没有<a href="#" class...="">

时间:2015-06-22 05:07:52

标签: javascript html ajax

I have an anchor which calls a server side class when clicked, but I want to modify it so that the class is called as soon as the page loads, without having to click an anchor.

<a href="#" class="_repLikeMore" data-id="1234" data-type="pid" data-app="forums">

1 个答案:

答案 0 :(得分:1)

触发点击事件,如下所示:

$('._repLikeMore').trigger('click');