Syn.prototype.then  function     

Then is used to chain a sequence of actions to be run one after the other. This is useful when many asynchronous actions need to be performed before some final check needs to be made.

The following clicks and types into the id='age' element and then checks that only numeric characters can be entered.

Example

Syn('click',{},'age')
  .then('type','I am 12',function(){
  equals($('#age').val(),"12") 
})
If the element argument is undefined, then the last element is used.

syn.then(type, options, element, callback) -> undefined
{String}

The type of event or action to create: "click", "dblclick", "drag", "type".

{Object}

Optiosn to pass to the event.

{optional:String|HTMLElement}

A element's id or an element. If undefined, defaults to the previous element.

{optional:Function}

A function to callback after the action has run, but before any future chained actions are run.

{undefined}
© Jupiter IT - JavaScriptMVC Training and Support