Boostrap Popover error: Uncaught TypeError: undefined is not a function <p>I am getting a Uncaught TypeError: undefined is not a function on one page of my site. The function works without error on all the other pages. its a bit of a lengthy page code wise so i will only post it if need be, but here is the basics.</p> <p><strong>the button for the popover:</strong></p> <pre><code>&lt;button class="btn btn-info" id="help" type="button" data-toggle="popover" data-trigger="focus" data-html="true" data-placement="bottom" title="ActiveMLS Documentation" data-content="&lt;small&gt;&lt;p&gt;&lt;strong&gt;List Custom Property Listings&lt;/strong&gt;&lt;/p&gt;&lt;/small&gt;"&gt;&lt;i class="fa fa-question-circle"&gt;&lt;/i&gt;&lt;/button&gt; </code></pre> <p><strong>the error</strong></p> <blockquote> <p>Uncaught TypeError: undefined is not a function shell.js:23</p> </blockquote> <p><strong>the jquery from shell.js line 23</strong></p> <pre><code>/*******************************/ /* POPOVER HELPER /*******************************/ $(document).ready(function(){ $('#help').popover() }); </code></pre> <p>I'm baffled as to why it breaks on this page only?</p> <pre><code>&lt;!-- blueimp Gallery styles --&gt; &lt;link rel="stylesheet" href="/static/uploadlib/css/blueimp-gallery.min.css"&gt; &lt;!-- CSS to style the file input field as button and adjust the Bootstrap progress bars --&gt; &lt;link rel="stylesheet" href="/static/uploadlib/css/jquery.fileupload-ui.css"&gt; &lt;div class="row-fluid"&gt; &lt;div class="col-md-12"&gt; &lt;div class="row-fluid"&gt; &lt;div class="section-header text-center"&gt; &lt;button class="btn btn-info" id="help" type="button" data-toggle="popover" data-trigger="focus" data-html="true" data-placement="bottom" title="ActiveMLS Documentation" data-content="&lt;small&gt;&lt;p&gt;&lt;strong&gt;List Custom Property Listings&lt;/strong&gt; - The list Custom Property listings page is an overview of all the Custom Property listings listings and information displayed on the website frontend&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Add Custom Property Listings&lt;/strong&gt; - Shortcut to the &lt;em&gt;Add Custom Property Listings&lt;/em&gt; page.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Records Per Page&lt;/strong&gt; - Display any list 10, 25, 50, or 100 records at a time.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt; - Search any list by keyword(s).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Listing ID&lt;/strong&gt; - The Custom Property ID of the Custom Property listing.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Address&lt;/strong&gt; - The address of the Custom Property listing.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Edit Custom Property Listing&lt;/strong&gt; - Access the &lt;em&gt;Edit Custom Property Listing&lt;/em&gt; page for this listing.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Delete Custom Property Listing&lt;/strong&gt; - Access the &lt;em&gt;Delete Custom Property Listing&lt;/em&gt; page for this listing.&lt;/li&gt;&lt;/ul&gt;&lt;/small&gt;"&gt;&lt;i class="fa fa-question-circle"&gt;&lt;/i&gt;&lt;/button&gt; &lt;!-- TMPL_IF add_mode --&gt; &lt;h1&gt;Add Custom Property Listing&lt;/h1&gt; &lt;!-- /TMPL_IF --&gt; &lt;!-- TMPL_IF edit_mode --&gt; &lt;h1&gt;Edit Custom Property Listing&lt;/h1&gt; &lt;!-- /TMPL_IF --&gt; &lt;!-- TMPL_IF delete_mode --&gt; &lt;h1&gt;Delete Custom Property Listing&lt;/h1&gt; &lt;!-- /TMPL_IF --&gt; &lt;/div&gt; &lt;/div&gt; &lt;form id="fileupload" method="post" action="&lt;!-- TMPL_VAR request_path --&gt;"&gt; &lt;div class="row-fluid"&gt; &lt;!-- TMPL_IF error_message --&gt; &lt;div class="alert alert-danger alert-dismissable" role="alert" &gt; &lt;button type="button" class="close" data-dismiss="alert"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; Warning!&lt;br /&gt; &lt;!-- TMPL_VAR error_message ESCAPE=0 --&gt; &lt;/div&gt; &lt;!-- /TMPL_IF --&gt; &lt;/div&gt; &lt;div class="row-fluid"&gt; &lt;fieldset&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Listing Category&lt;/label&gt; &lt;!-- TMPL_VAR category ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Listing ID&lt;/label&gt; &lt;!-- TMPL_VAR listing_id ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Agent Name&lt;/label&gt; &lt;!-- TMPL_VAR l_ag1_id ESCAPE=0 --&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;hr /&gt; &lt;div class="row-fluid"&gt; &lt;fieldset&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Price&lt;/label&gt; &lt;!-- TMPL_VAR price ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="row-fluid"&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Street Address&lt;/label&gt; &lt;!-- TMPL_VAR street_no ESCAPE=0 --&gt; &lt;!-- TMPL_VAR street ESCAPE=0 --&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;City&lt;/label&gt; &lt;!-- TMPL_VAR city ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;State&lt;/label&gt; &lt;!-- TMPL_VAR state ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Zip Code&lt;/label&gt; &lt;!-- TMPL_VAR zip ESCAPE=0 --&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;hr /&gt; &lt;div class="row-fluid"&gt; &lt;fieldset&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Description&lt;/label&gt; &lt;!-- TMPL_VAR remarks_general ESCAPE=0 --&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;hr /&gt; &lt;div class="row-fluid"&gt; &lt;fieldset&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Business Type&lt;/label&gt; &lt;!-- TMPL_VAR business_type ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;For Lease&lt;/label&gt; &lt;!-- TMPL_VAR for_lease_yn ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;For Sale&lt;/label&gt; &lt;!-- TMPL_VAR for_sale_yn ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Parcel Type&lt;/label&gt; &lt;!-- TMPL_VAR parcel_type ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Area&lt;/label&gt; &lt;!-- TMPL_VAR area_desc ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;County&lt;/label&gt; &lt;!-- TMPL_VAR county ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;School District&lt;/label&gt; &lt;!-- TMPL_VAR schools_d ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Elementary School&lt;/label&gt; &lt;!-- TMPL_VAR schools_e ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;High School&lt;/label&gt; &lt;!-- TMPL_VAR schools_h ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Year Built&lt;/label&gt; &lt;!-- TMPL_VAR year_built ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Type&lt;/label&gt; &lt;!-- TMPL_VAR type ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Rooms&lt;/label&gt; &lt;!-- TMPL_VAR no_rooms ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Bedrooms&lt;/label&gt; &lt;!-- TMPL_VAR bdrms ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Baths, Full&lt;/label&gt; &lt;!-- TMPL_VAR baths_full ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Baths, Half&lt;/label&gt; &lt;!-- TMPL_VAR baths_part ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Approx. Sq. Ft.&lt;/label&gt; &lt;!-- TMPL_VAR sqft ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Approx. Lot Size&lt;/label&gt; &lt;!-- TMPL_VAR lot_size ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Approx. Acre&lt;/label&gt; &lt;!-- TMPL_VAR acres ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Foundation&lt;/label&gt; &lt;!-- TMPL_VAR foundation ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Exterior&lt;/label&gt; &lt;!-- TMPL_VAR exterior ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Heating&lt;/label&gt; &lt;!-- TMPL_VAR heating ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Cooling&lt;/label&gt; &lt;!-- TMPL_VAR cooling ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Fuel&lt;/label&gt; &lt;!-- TMPL_VAR heat_fuel ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Parking Spaces&lt;/label&gt; &lt;!-- TMPL_VAR gar_prk_no ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Sewer&lt;/label&gt; &lt;!-- TMPL_VAR sewer ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Water&lt;/label&gt; &lt;!-- TMPL_VAR water ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Fireplace&lt;/label&gt; &lt;!-- TMPL_VAR fireplace ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Tax 1&lt;/label&gt; &lt;!-- TMPL_VAR tax_1 ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Tax 2&lt;/label&gt; &lt;!-- TMPL_VAR tax_2 ESCAPE=0 --&gt; &lt;/div&gt; &lt;div class="form-group col-md-6"&gt; &lt;label class="col-md-6"&gt;Six Month Tax&lt;/label&gt; &lt;!-- TMPL_VAR six_mo_taxes ESCAPE=0 --&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;hr /&gt; &lt;!-- TMPL_IF delete_mode --&gt; &lt;p&gt; &lt;!-- TMPL_LOOP Thumbnails --&gt; &lt;img src="/custom_prop/photo_thumbnail?filename=&lt;!-- TMPL_VAR filename --&gt;"&gt; &lt;!-- /TMPL_LOOP --&gt; &lt;/p&gt; &lt;!-- TMPL_ELSE --&gt; &lt;!-- Start Upload --&gt; &lt;noscript&gt;&lt;p&gt;JavaScript is required for photo upload.&lt;/p&gt;&lt;/noscript&gt; &lt;input type="hidden" name="nonce" value="&lt;!-- TMPL_VAR nonce --&gt;"/&gt; &lt;!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload --&gt; &lt;div class="row fileupload-buttonbar"&gt; &lt;div class="col-md-7"&gt; &lt;!-- The fileinput-button span is used to style the file input field as button --&gt; &lt;span class="btn btn-success fileinput-button"&gt; &lt;i class="icon-plus icon-white"&gt;&lt;/i&gt; &lt;span&gt;Add photos...&lt;/span&gt; &lt;input type="file" name="files" multiple&gt; &lt;/span&gt; &lt;button type="submit" class="btn btn-primary start"&gt; &lt;i class="icon-upload icon-white"&gt;&lt;/i&gt; &lt;span&gt;Start upload&lt;/span&gt; &lt;/button&gt; &lt;button type="reset" class="btn btn-warning cancel"&gt; &lt;i class="icon-ban-circle icon-white"&gt;&lt;/i&gt; &lt;span&gt;Cancel upload&lt;/span&gt; &lt;/button&gt; &lt;button type="button" class="btn btn-danger delete"&gt; &lt;i class="icon-trash icon-white"&gt;&lt;/i&gt; &lt;span&gt;Delete&lt;/span&gt; &lt;/button&gt; &lt;!-- The loading indicator is shown during file processing --&gt; &lt;span class="fileupload-loading"&gt;&lt;/span&gt; &lt;/div&gt; &lt;!-- The global progress information --&gt; &lt;div class="span5 fileupload-progress fade"&gt; &lt;!-- The global progress bar --&gt; &lt;div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"&gt; &lt;div class="bar" style="width:0%;"&gt;&lt;/div&gt; &lt;/div&gt; &lt;!-- The extended global progress information --&gt; &lt;div class="progress-extended"&gt;&amp;nbsp;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- The table listing the files available for upload/download --&gt; &lt;table role="presentation" class="table table-striped"&gt;&lt;tbody class="files"&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;!-- The blueimp Gallery widget --&gt; &lt;div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even"&gt; &lt;div class="slides"&gt;&lt;/div&gt; &lt;h3 class="title"&gt;&lt;/h3&gt; &lt;a class="prev"&gt;‹&lt;/a&gt; &lt;a class="next"&gt;›&lt;/a&gt; &lt;a class="close"&gt;×&lt;/a&gt; &lt;a class="play-pause"&gt;&lt;/a&gt; &lt;ol class="indicator"&gt;&lt;/ol&gt; &lt;/div&gt; &lt;!-- /TMPL_IF --&gt; &lt;div class="row"&gt; &lt;div class="col-md-6"&gt; &lt;!-- TMPL_IF edit_mode --&gt; &lt;input type="submit" name="submit" class="btn btn-primary" value="Save"/&gt; &lt;input type="submit" name="cancel" class="btn" value="Cancel"/&gt; &lt;!-- /TMPL_IF --&gt; &lt;!-- TMPL_IF add_mode --&gt; &lt;input type="submit" name="submit" class="btn btn-primary" value="Save"/&gt; &lt;input type="submit" name="cancel" class="btn" value="Cancel"/&gt; &lt;!-- /TMPL_IF --&gt; &lt;!-- TMPL_IF delete_mode --&gt; &lt;p&gt;Are you sure you want to delete this listing?&lt;/p&gt; &lt;input type="submit" name="confirm" class="btn btn-primary" value="Yes"/&gt; &lt;input type="submit" name="cancel" class="btn" value="No"/&gt; &lt;!-- /TMPL_IF --&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- The template to display files available for upload --&gt; &lt;script id="template-upload" type="text/x-tmpl"&gt; {% for (var i=0, file; file=o.files[i]; i++) { %} &lt;tr class="template-upload fade"&gt; &lt;td&gt; &lt;span class="preview"&gt;&lt;/span&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="name"&gt;{%=file.name%}&lt;/p&gt; {% if (file.error) { %} &lt;div&gt;&lt;span class="label label-important"&gt;Error&lt;/span&gt; {%=file.error%}&lt;/div&gt; {% } %} &lt;/td&gt; &lt;td&gt; &lt;p class="size"&gt;{%=o.formatFileSize(file.size)%}&lt;/p&gt; {% if (!o.files.error) { %} &lt;div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"&gt;&lt;div class="bar" style="width:0%;"&gt;&lt;/div&gt;&lt;/div&gt; {% } %} &lt;/td&gt; &lt;td&gt; {% if (!o.files.error &amp;&amp; !i &amp;&amp; !o.options.autoUpload) { %} &lt;button class="btn btn-primary start"&gt; &lt;i class="icon-upload icon-white"&gt;&lt;/i&gt; &lt;span&gt;Start&lt;/span&gt; &lt;/button&gt; {% } %} {% if (!i) { %} &lt;button class="btn btn-warning cancel"&gt; &lt;i class="icon-ban-circle icon-white"&gt;&lt;/i&gt; &lt;span&gt;Cancel&lt;/span&gt; &lt;/button&gt; {% } %} &lt;/td&gt; &lt;/tr&gt; {% } %} &lt;/script&gt; &lt;!-- The template to display files available for download --&gt; &lt;script id="template-download" type="text/x-tmpl"&gt; {% for (var i=0, file; file=o.files[i]; i++) { %} &lt;tr class="template-download fade"&gt; &lt;td&gt; &lt;span class="preview"&gt; {% if (file.thumbnailUrl) { %} &lt;a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery&gt;&lt;img src="{%=file.thumbnailUrl%}"&gt;&lt;/a&gt; {% } %} &lt;/span&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="name"&gt; &lt;a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}&gt;{%=file.name%}&lt;/a&gt; &lt;/p&gt; {% if (file.error) { %} &lt;div&gt;&lt;span class="label label-important"&gt;Error&lt;/span&gt; {%=file.error%}&lt;/div&gt; {% } %} &lt;/td&gt; &lt;td&gt; &lt;span class="size"&gt;{%=o.formatFileSize(file.size)%}&lt;/span&gt; &lt;/td&gt; &lt;td&gt; &lt;button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}&gt; &lt;i class="icon-trash icon-white"&gt;&lt;/i&gt; &lt;span&gt;Delete&lt;/span&gt; &lt;/button&gt; &lt;/td&gt; &lt;/tr&gt; {% } %} &lt;/script&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"&gt;&lt;/script&gt; &lt;!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included --&gt; &lt;script src="/static/uploadlib/js/vendor/jquery.ui.widget.js"&gt;&lt;/script&gt; &lt;!-- The Templates plugin is included to render the upload/download listings --&gt; &lt;script src="/static/uploadlib/js/tmpl.min.js"&gt;&lt;/script&gt; &lt;!-- The Load Image plugin is included for the preview images and image resizing functionality --&gt; &lt;script src="/static/uploadlib/js/load-image.min.js"&gt;&lt;/script&gt; &lt;!-- blueimp Gallery script --&gt; &lt;script src="/static/uploadlib/js/jquery.blueimp-gallery.min.js"&gt;&lt;/script&gt; &lt;!-- The Iframe Transport is required for browsers without support for XHR file uploads --&gt; &lt;script src="/static/uploadlib/js/jquery.iframe-transport.js"&gt;&lt;/script&gt; &lt;!-- The basic File Upload plugin --&gt; &lt;script src="/static/uploadlib/js/jquery.fileupload.js"&gt;&lt;/script&gt; &lt;!-- The File Upload processing plugin --&gt; &lt;script src="/static/uploadlib/js/jquery.fileupload-process.js"&gt;&lt;/script&gt; &lt;!-- The File Upload image preview &amp; resize plugin --&gt; &lt;script src="/static/uploadlib/js/jquery.fileupload-image.js"&gt;&lt;/script&gt; &lt;!-- The File Upload validation plugin --&gt; &lt;script src="/static/uploadlib/js/jquery.fileupload-validate.js"&gt;&lt;/script&gt; &lt;!-- The File Upload user interface plugin --&gt; &lt;script src="/static/uploadlib/js/jquery.fileupload-ui.js"&gt;&lt;/script&gt; &lt;!-- The main application script --&gt; &lt;script&gt; $(function () { 'use strict'; // Initialize the jQuery File Upload widget: $('#fileupload').fileupload({ url: '/custom_prop/file_upload_handler?nonce=&lt;!-- TMPL_VAR nonce --&gt;' }); // Load existing files: $('#fileupload').addClass('fileupload-processing'); $.ajax({ 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, null, {result: result}); }); }); &lt;/script&gt; &lt;!-- End Upload --&gt; </code></pre>