问题
I'm not an programmer, but I know something. I need very simple script for GreaseMonkey (JQuery). Script which after 4 sec click on link (http://ptzplace.eu/login.php here is it). I need script which click on "Login click" after 4 sec.
BTW. It's simulator and u can put in login and password anything u want for test.
Regards
回答1:
setTimeout() && jQuerys .trigger() should do it:
setTimeout(function() {
$('#login_button_id').trigger('click');
}, 4e3);
Demo: http://jsfiddle.net/WTJgt/9/
update
In reference to your comment, just change the selector. Query by classname:
$('.logIn').trigger('click');
回答2:
But what if button doesn't have an id? Look at the source, it's only class. look at source ptzplace.eu ;): <a class="signIn" href="#" onClick="doLogin(); return false;"></a>
来源:https://stackoverflow.com/questions/4818237/jquery-automatic-click-after-4-sec