/    Sign up×
Community /Pin to ProfileBookmark

Detedting the state of an Applet

Hi
I am not relly familiar with javascript but I need it to run a web application hanging off a database. Within this application I have OnLoad code to do various things when a page is loaded. In some instances this code will call another page. Due to security issues I need to hit my database each time I call a new page so I have to run through the event broker applet.
The problem is that in some cases the page may be loaded and will therefore trigger the onload code but the applet may not be ready and will therefore pop an error saying can’t connect etc,. Is there any javascript function which can detect the state of an applet and tell the code whether its ready for use or not.
Otherwise, I was wondering about the use of “try…catch” statement. Could this be used to try and perform the action involving the applet and if not ready use the catch to delay for x milliseconds and then run the command again. Can you only have one catch per try or could you keep repeating this procedure in a kind of a loop.

Thanks. Any help will be appreciated

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @john_s 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.18,
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,
)...