title: Uncaught TypeError: undefined is not a function with custom jQuery Plugin
body: <p>I have made a wrapper plugin for the jquery autocomplete plugin as we use it everywhere on our projects and need to globally change it at times, however whenever i reference the plugin i get the error: <code>Uncaught TypeError: undefined is not a function</code> my pluggin looks like so:</p>
  
  <pre><code>(function ($) {
  $.fn.CustomAutocomplete = function (options) {
      //Settings
      alert("test");
      var settings = $.extend({
          //Defaults
          ContollerMethodLink: "",
          ReturnElement: ""
      }, options);
  
      $(this).autocomplete({
          source: function (request, response) {
              var employees = new Array();
              $.ajax({
                  async: false,
                  cache: false,
                  type: "POST",
                  url: ContollerMethodLink,
                  data: { "query": request.term },
                  success: function (data) {
                      for (var i = 0; i &lt; data.length; i++) {
                          employees[i] = { label: data[i].Key, Id: data[i].Value };
                      }
                  }
              });
              response(employees);
          },
          select: function (event, ui) {
              //fill selected customer details on form
              var id = ui.item.Id;
              $('#' + settings.ReturnElement).val(id);
          }
      });
  }
  })(jQuery);
  </code></pre>
  
  <p>I then call it like so:</p>
  
  <pre><code>    $(document).ready(function() {
          $('#AddReportingEmpText').CustomAutocomplete({
              ReturnElement: "AddReportingEmpId",
              ContollerMethodLink: "@(Url.Action("Method", "Controllers"))",
          });
      });
  </code></pre>
  
  <p>However when i try to use this i get the said error in a random empty space right above <code>$(document).ready(function() {</code> if i hard code out the ajax request in the spot where i am currently calling my plugin, everything works fine. Any ideas?</p>
  
  <p>Edit:
  worth noting this is my JS File call:</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I then call my plugin file and the debugger shows me it is being properly included</p>