title: assignment is not working in external js file
body: <p>friends i have created a new js file for autocomplete. Everything is working fine except one line  " receivingAutocompleteData = data.autcompleteData;" 
  right hand side value is not assigned to left hand side.</p>
  
  <pre><code>var ArrayAutocomplete = [];
  var receivingAutocompleteData ;
  function AutoComplete1(txtBoxName, idField, fieldName) {
  debugger;
  ArrayAutocomplete = [];
  
  var selectedReqType = $("#" + txtBoxName).val();
  
  $("#" + txtBoxName).unautocomplete();
  $("#" + txtBoxName).val("");
  
  $("#" + txtBoxName).val("Loading...........");
  $("#" + txtBoxName).attr("disabled", true);
  
  
  // var rea=  "&lt;%= Url.RouteUrl(new { controller = "Request", action =   "AutoSelectionDataForRequestType"}) %&gt;";
  var rea = getURL(fieldName);
  $.post(rea, {}, function (data) {
      debugger;
      receivingAutocompleteData = data.autcompleteData;
      jQuery.each(receivingAutocompleteData, function (i, val) {
          if (val.Name != "")
              ArrayAutocomplete.push(val.Name + '|' + val.ID);
      });
      ArrayAutocomplete.sort();
  
      //   alert(ArrayAutocomplete.length);
      //  alert(ArrayAutocomplete);
      $("#" + txtBoxName).autocomplete(ArrayAutocomplete, {
  
          minChars: 0,
          max: ArrayAutocomplete.length,
          autoFill: true,
          mustMatch: true,
          matchContains: false,
          multipleSeparator: ',-',
          scrollHeight: 220,
  
          formatItem: function (data, index, max) {
              return data[0];
          },
          formatMatch: function (data, index, max) {
              return data[0];
          }, formatResult: function (data, index, max) {
              return data[0];
          }
      }).result(function (event, data, formatted) {
          if (data)
              $("#" + idField).val(data[1]);
          else
              $("#" + idField).val('-1');
      });
      $("#" + txtBoxName).val("");
      $("#" + txtBoxName).attr("disabled", false);
      $("#" + txtBoxName).Watermark("--Select--");
  
      if (selectedReqType != '')
          $("#" + txtBoxName).val(selectedReqType);
     });
  </code></pre>
  
  <p>}</p>