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">
答案 0 :(得分:1)
触发点击事件,如下所示:
$('._repLikeMore').trigger('click');