Link to home
Start Free TrialLog in
Avatar of tonelm54
tonelm54

asked on

Call function

Is it possible to call a function from within a function? But if function isnt declared do nothing?

function showUrlInDialog(options){
     (options.onOpen || function () { /*Do nothing*/ });
     }

showUrlInDialog({
     myValue1:27,
     myValue2:45,
     onOpen: function () { alert('hello'); }
     });

Open in new window

SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You will get an undefined error if you have not declared the function before.