I got this string of code, data is value returned inside a success callback in an ajax environment:
$('#cpt_rspp_value').text(data.Payload.Clerks.rspp.full_name)
$('#cpt_ddl_value').text(data.Payload.Clerks.ddl.full_name)
$('#cpt_rls_value').text(data.Payload.Clerks.rls.full_name)
$('#cpt_mc_value').text(data.Payload.Cler.mc.full_name)
$('#cpt_se_value').text(data.Payload.Clerks.se.full_name)
If, rspp
really exists inside the DB the object data.Payload.Clerks.rspp.full_name
will be present, so I can put it in right place (i.e: #cpt_rspp_value
).
But, alas, if that object doesn't exist, the js interpreter will stop, and so, even if next objects data.Payload.Clerks.ddl.full_name
, data.Payload.Clerks.rls.full_name
and so on, will be present, that row will never been processed.
I should "if" any lines, but how? if(data.Payload.Clerks.rspp.full_name)
and if(data.Payload.Clerks.rspp.full_name != null)
don't resolve the issue.
What can I do?