Avatar of mjfigur
mjfigur
 asked on

Syntax setTimeout JQuery

I just need some help with my syntax. I am trying to add to the code below a try and catch statement so that when .change calls the function it does a try on:

$(this).htmldbSetSession({
   success:function(){
    refreshEmp();

and then catch(ex) it would set a timeout of 100ms.

Not sure how to code this and the syntax need help please.

$(function(){
 $('#P20_MANAGER_NAME').htmldbCascade(
  '#P20_DEPARTMENT_NAME',
  'MANAGER_CASCADE_OPT_GRP_LOV',{
  parentSession:true,
  parentTrigger:'change'
 });
 $('#P20_EMPLOYEE_NAME').htmldbCascade(
  '#P20_MANAGER_NAME',
  'EMPLOYEE_CASCADE_OPT_GRP_LOV',{
  parentSession:true
 }).change(function(){ 
  /* bind change event to set session state and refresh report */
  $(this).htmldbSetSession({
   success:function(){
    refreshEmp();
   }
  });
 });
});

Open in new window

JavaScriptAJAX

Avatar of undefined
Last Comment
Gurvinder Pal Singh

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gurvinder Pal Singh

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.
fblack61