In my code I've a method that check if a select option is clicked or not, like this:
$("#selected-service").click(function ()
now all working fine, but inside of this method I valorize this variable:
var appointment = BackendCalendar.lastFocusedEventData.data;
in some case this variable is returned undefined, and this is normal 'cause this variable rapresent if the user is in the edit mode or adding mode of an appointment. In the first case the variable was returned undefined as well. Anyway, I perform this condition:
try
{
var appointment = BackendCalendar.lastFocusedEventData.data;
if (appointment != 'undefined')
{
//do this...
}
else
{
//do this...
}
}
catch(Ex){ console.log("Error=>" , Ex); }
but the problem is that the else condition is never fire 'cause the code go in the catch exception. Now, the question is simple: how I can bring in the else if the variable is undefined?
POSSIBLE SOLUTION:
if(typeof(BackendCalendar.lastFocusedEventData !== 'undefined'))
{
appointment = BackendCalendar.lastFocusedEventData.data;
}