Jquery UI Autocomplete. What am I doing wrong here?

Jquery UI Autocomplete. What am I doing wrong here?

I am using Jquery UI Autocomplete to get a list of names. But for some reason I am getting error



This is the Autocomplete code

  1. $('#repName').removeAttr('readonly').focus(function () {
  2.                     $(this).val('');
  3.                 }).autocomplete({
  4.                     source: function (request, response) {
  5.                         tagId = $('#TagId').val();
  6.                         $.ajax({
  7.                             url: '/Developement/GetRepName', type: 'POST', dataType: 'json',
  8.                             data: { searchText: request.term, maxResults: 10, tagId: tagId },
  9.                             success: function (data) {
  10.                                 response($.map(data, function (item) {
  11.                                     return {
  12.                                         label: item.Name,
  13.                                         value: item.RepId,
  14.                                         id: item.RepId
  15.                                     }
  16.                                 }))
  17.                             }
  18.                         })
  19.                     },
  20.                     select: function (event, ui) {
  21.                         commissionAllicationModifications(ui.item.id, 0, 'A');
  22.                     }
  23.                 });
I have no clue why this is happening. 
I am using Jquery UI 1.8.1

I would appreciate any kind of help on this.