What is the point of doing this:
var resultsArray = (typeof response.d) == 'string'
? eval('(' + response.d + ')') : response.d;
inside onSuccess() callback of $.(ajax) call?
What is the point of doing this:
var resultsArray = (typeof response.d) == 'string'
? eval('(' + response.d + ')') : response.d;
inside onSuccess() callback of $.(ajax) call?
var resultsArray = /* assign a value to resultsArray... */
(typeof response.d) == 'string' ? /* ...if the type of response.d is string */
eval('(' + response.d + ')') : /* ...then evaluate it as if it was JS code */
response.d; /* ...else just assign it unaltered */