title: jQuery.Deferred exception: $(...).datepicker is not a function
body: <p>thanks in advance.</p>
  
  <p>I have already searched and implemented </p>
  
  <pre><code> $(document).ready(function () {
       $("#ui-datepicker").datepicker();
      });
  </code></pre>
  
  <p>and </p>
  
  <pre><code>$(function () {
      if (!Modernizr.inputtypes.date) {
          $('input[type=date]').datepicker({
              dateFormat: 'dd-mm-yyyy'
          }
           );
      }
  });
  </code></pre>
  
  <p>but unable to resolve the issue. So, Please look at my code below and tel me what is the issue</p>
  
  <pre><code>&lt;html class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths" style=""&gt;
  &lt;head&gt;
    &lt;link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"&gt;
      &lt;link href="/Content/bootstrap.min.css" rel="stylesheet"&gt;
      &lt;link href="/Content/font-awesome.min.css" rel="stylesheet"&gt;
      &lt;link href="/Content/animate.css" rel="stylesheet"&gt;
      &lt;link href="/Content/style.css" rel="stylesheet"&gt;
      &lt;script src="/Scripts/modernizr-2.8.3.js"&gt;&lt;/script&gt;
      &lt;!-- Tweaks for older IEs--&gt;
      &lt;!--[if lt IE 9]&gt;
          &lt;script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"&gt;&lt;/script&gt;
          &lt;script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"&gt;&lt;/script&gt;
      &lt;![endif]--&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;div class="section-modal modal fade in" id="new-product-modal" tabindex="-1" role="dialog" aria-hidden="true" style="display: block;overflow-y:scroll;"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="close-modal" data-dismiss="modal"&gt;
                  &lt;a href="/"&gt;
                      &lt;div class="lr"&gt;
                          &lt;div class="rl"&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="container"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="section-title text-center"&gt;
                          &lt;h3&gt;Products&lt;/h3&gt;
                          &lt;p&gt;Add a new product into List&lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;form returnurl="" action="/Home/Products" enctype="multipart/form-data" method="post"&gt;
                      &lt;input name="__RequestVerificationToken" value="Cni4uRd3UIZMvQsCWzpt3GQRxRmybm2yKX2xsOHkvS2D_f4qezvaBU38Mg6HYOJZwwe7bIYpjvWSgYOzdA2LxN3MBxG8uGvvB4-xN4W1LK41" type="hidden"&gt;                &lt;div class="row form-group warning-message-container"&gt;
                          &lt;div class=" danger" style="color:red;background-color:lightpink;border-radius:0.3em;text-align:center;"&gt;&lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="form-group text-right"&gt;
                                  &lt;label class="form-label" for="ProductName"&gt;Product Name&lt;/label&gt; &lt;span style="color:red;"&gt;*&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-6"&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;input class="form-control" data-val="true" data-val-required="The ProductName field is required." id="name" name="ProductName" placeholder="Your Product Name *" value="" type="text"&gt;
                                  &lt;span class="field-validation-valid" data-valmsg-for="ProductName" data-valmsg-replace="true"&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                       &lt;div class="row"&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="form-group text-right"&gt;
                                  &lt;label class="form-label" for="Stock"&gt;Stock&lt;/label&gt; &lt;span style="color:red;"&gt;*&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-6"&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;div class="col-sm-6"&gt;
                                      &lt;div class="row form-group"&gt;
                                          &lt;input class="form-control" data-val="true" data-val-number="The field Stock must be a number." data-val-required="The Stock field is required." id="name" name="Stock" placeholder="Your Stock *" value="0" type="text"&gt;
                                          &lt;span class="field-validation-valid" data-valmsg-for="Stock" data-valmsg-replace="true"&gt;&lt;/span&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                                  &lt;div class="col-sm-6"&gt;
                                      &lt;div class="form-group"&gt;
                                          &lt;select class="form-control" data-val="true" data-val-number="The field Stock Unit must be a number." data-val-required="The Stock Unit field is required." id="StockUnit" name="SelectedStockUnit" placeholder="Select Unit *"&gt;
                                              &lt;option selected="selected" value="0"&gt;Select a Unit&lt;/option&gt;
                                              &lt;option value="1"&gt;Kilogram&lt;/option&gt;
                                              &lt;option value="2"&gt;Grams&lt;/option&gt;
                                              &lt;option value="3"&gt;Ton&lt;/option&gt;
                                              &lt;option value="4"&gt;Liter&lt;/option&gt;
                                              &lt;option value="5"&gt;Dozen&lt;/option&gt;
                                              &lt;option value="6"&gt;Quintel&lt;/option&gt;
                                              &lt;option value="7"&gt;Milli Gram&lt;/option&gt;
                                              &lt;option value="8"&gt;Peices&lt;/option&gt;
                                          &lt;/select&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                       &lt;div class="row"&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="form-group text-right"&gt;
                                  &lt;label class="form-label" for="StockDate"&gt;Stock available on Date&lt;/label&gt; &lt;span style="color:red;"&gt;*&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-6"&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;input class="text-box single-line" data-val="true" data-val-date="The field Stock on Date must be a date." data-val-required="The Stock on Date field is required." id="StockDate" name="StockDate" value="01/01/0001" type="date"&gt;
                                  &lt;span class="field-validation-valid" data-valmsg-for="StockDate" data-valmsg-replace="true"&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                          &lt;div class="row"&gt;
                          &lt;div class="col-md-3"&gt;
                              &lt;div class="form-group text-right"&gt;
                                  &lt;label class="form-label" for="ProductDesc"&gt;Product Description&lt;/label&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="col-md-6"&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;textarea class="form-control" cols="20" id="ProductDesc" name="ProductDesc" placeholder="Product Description" rows="2" type="text"&gt;&lt;/textarea&gt;
                                  &lt;span class="field-validation-valid" data-valmsg-for="ProductDesc" data-valmsg-replace="true"&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="clearfix"&gt;&lt;/div&gt;
                          &lt;div class="col-lg-12 text-center"&gt;
                              &lt;div id="success"&gt;&lt;/div&gt;
                              &lt;button type="submit" class="btn btn-primary" value="Save"&gt;Save&lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  
      &lt;script src="/Scripts/jquery-ui-1.12.1.js"&gt;&lt;/script&gt;
      &lt;script src="/Scripts/jquery-3.1.1.js"&gt;&lt;/script&gt;
      &lt;script src="/Scripts/jquery.appear.js"&gt;&lt;/script&gt;
      &lt;script src="/Scripts/bootstrap.js"&gt;&lt;/script&gt;
      &lt;script src="/Scripts/Custom/DatePickerReady.js"&gt;&lt;/script&gt;
      &lt;script src="/Scripts/respond.matchmedia.addListener.js"&gt;&lt;/script&gt;
      &lt;script src="/Scripts/respond.js"&gt;&lt;/script&gt;
      &lt;script src="/Scripts/Custom/dropdownlist.js"&gt;&lt;/script&gt;
      &lt;script src="/Scripts/script.js"&gt;&lt;/script&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>the date-time picker is not working on Mozilla Firefox.</p>