/    Sign up×
Community /Pin to ProfileBookmark

Auto-click a button?

Ok, I’ve searched and searched and I can’t find a solution to what I want exactly. I’m still real new to Javascript maybe that’s my problem ?

Ok so let me start by explaining. I have a welcome page to my site and at the bottom there is a “Enter Site” button I made with Javascript code. Now, when that button is clicked 2 functions occur simultaneously.

1) the visitor is redirected to the main site
2) a window is opened

So when people go to the main welcome page (with the button) I want a code to automatically after 1 second (or whatever) click that button so both functions are executed as if the button was clicked manually.

Any help?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@nathandelaneSep 28.2009 — Well you could create a third function that calls the other two functions and then:
<i>
</i>setTimeout("thirdFunction();", 1000);


Which would call the third function every 1000 milliseconds or every one second (except that the first time you call it it'll take the user to the next page, and the function won't run anymore).
×

Success!

Help @ns4u spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...