Vikram

Vikram

  • 1.3k
  • 433
  • 76.9k

explain this jquery code please

Nov 9 2015 11:51 PM
please explain this code what is label:item.split and all 
 
function (data)
{
if (data.d.length > 0)
{
response($.map(data.d, function (item)
{
return {
label: item.split('/')[0],
val: item.split('/')[1]
}
}));
}
else {
response([{ label: 'No Records Found', val: -1 }]);
$('#txtSearch').val('');
}
}
Thanks in advance 

Answers (2)