title: jQuery File Upload. Cannot read property 'innerHTML' of null
body: <p>I'm trying to use blueimp's jQuery File Upload plugin in my project. This is works perfect in version Basic Plus, i am able to load files on server, but when i am trying to use Basic Plus UI (<a href="https://blueimp.github.io/jQuery-File-Upload/basic-plus.html" rel="nofollow noreferrer">link</a>) i am getting error:</p>
  
  <pre><code>tmpl.min.js:1 Uncaught TypeError: Cannot read property 'innerHTML' of null
      at Function.n.load (http://127.0.0.1:8000/static/cp/file_upload/tmpl.min.js:1:324)
      at n (http://127.0.0.1:8000/static/cp/file_upload/tmpl.min.js:1:208)
      at n (http://127.0.0.1:8000/static/cp/file_upload/tmpl.min.js:1:204)
      at $.(anonymous function).(anonymous function)._initTemplates (http://127.0.0.1:8000/static/cp/file_upload/jquery.fileupload-ui.js:661:46)
      at $.(anonymous function).(anonymous function)._initTemplates (http://127.0.0.1:8000/static/cp/file_upload/vendor/jquery.ui.widget.js:127:25)
      at $.(anonymous function).(anonymous function)._initSpecialOptions (http://127.0.0.1:8000/static/cp/file_upload/jquery.fileupload-ui.js:681:18)
      at $.(anonymous function).(anonymous function)._initSpecialOptions (http://127.0.0.1:8000/static/cp/file_upload/vendor/jquery.ui.widget.js:127:25)
      at $.(anonymous function).(anonymous function)._create (http://127.0.0.1:8000/static/cp/file_upload/jquery.fileupload.js:1390:18)
      at $.(anonymous function).(anonymous function)._create (http://127.0.0.1:8000/static/cp/file_upload/vendor/jquery.ui.widget.js:127:25)
      at $.(anonymous function).(anonymous function)._super (http://127.0.0.1:8000/static/cp/file_upload/vendor/jquery.ui.widget.js:114:36)
  </code></pre>
  
  <p>Here is order of js requirements in my project:</p>
  
  <pre><code>vendor/jquery.ui.widget.js
  JavaScript-Templates/js/tmpl.min.js
  JavaScript-Load-Image/js/load-image.all.min.js
  canvas-to-blob.min.js
  jquery.iframe-transport.js
  jquery.fileupload.js
  jquery.fileupload-process.js
  jquery.fileupload-image.js
  jquery.fileupload-validate.js
  jquery.fileupload-ui.js
  </code></pre>
  
  <p>Actually, i am getting this error message even if i copy/paste source code from example.</p>
  
  <p>Edit:</p>
  
  <p>here is html code:</p>
  
  <pre><code>&lt;input id="fileupload" type="file" name="files[]" class="form-control" multiple&gt;
  &lt;div id="files" class="files"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>javascript (copied from blueimp example):</p>
  
  <pre><code>$(function () {
      'use strict';
  
      // Initialize the jQuery File Upload widget:
      $('#fileupload').fileupload({
          // Uncomment the following to send cross-domain cookies:
          //xhrFields: {withCredentials: true},
          url: '{% url 'add_request' %}',
      });
  
      // Enable iframe cross-domain access via redirect option:
      $('#fileupload').fileupload(
          'option',
          'redirect',
          window.location.href.replace(
              /\/[^\/]*$/,
              '/cors/result.html?%s'
          )
      );
  
      if (window.location.hostname === 'blueimp.github.io') {
          // Demo settings:
          $('#fileupload').fileupload('option', {
              url: '//jquery-file-upload.appspot.com/',
              disableImageResize: /Android(?!.*Chrome)|Opera/
                  .test(window.navigator.userAgent),
              maxFileSize: 999000,
              acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
          });
          // Upload server status check for browsers with CORS support:
          if ($.support.cors) {
              $.ajax({
                  url: '//jquery-file-upload.appspot.com/',
                  type: 'HEAD'
              }).fail(function () {
                  $('&lt;div class="alert alert-danger"/&gt;')
                      .text('Upload server currently unavailable - ' +
                              new Date())
                      .appendTo('#fileupload');
              });
          }
      } else {
          // Load existing files:
          $('#fileupload').addClass('fileupload-processing');
          $.ajax({
              // Uncomment the following to send cross-domain cookies:
              //xhrFields: {withCredentials: true},
              url: $('#fileupload').fileupload('option', 'url'),
              dataType: 'json',
              context: $('#fileupload')[0]
          }).always(function () {
              $(this).removeClass('fileupload-processing');
          }).done(function (result) {
              $(this).fileupload('option', 'done')
                  .call(this, $.Event('done'), {result: result});
          });
      }
  
  });
  </code></pre>