17

I'm trying to use the jQuery-File-Upload plugin. But I have a problem when actually trying to invoke the function. Somewhere in my code, I'll call $(fubar).fileupload, and get Uncaught TypeError: Object #<Object> has no method '_on' jquery.fileupload.js:977. Now this is happening after the page and all js scripts have been loaded.

A) A similar error is discussed in the tool's boards. I tried the technique of including jquery.fileupload.js just after the dom loads. I tried the technique, with something like below.

  <script src='/static/presentation/js/lib/jquery.fileupload.js'></script>
  <script src='/static/presentation/js/lib/jquery.iframe-transport.js'></script>
</body>

But when loading the page, I get another error Uncaught Error: Mismatched anonymous define() module: function ($) {... .

B) On documentReady, I even tried dynamically generating and including the script tags, in head. But I get the same error Uncaught Error: Mismatched anonymous define() module: function ($) {... .

I'm using jquery-file-upload with requirejs. I only bring that up I tested out the library and got it working with a plain jane static site. Just the basic js library files. So I don't know what's causing this. But it doesn't seem to be DOM related.

Any help is appreciated.


Ok, I just figured it out. I simply need to include jquery.fileupload.js after jquery.ui.widget.js and jquery.iframe-transport.js . At least I know for future reference.

<script src='/static/presentation/js/lib/jquery.ui.widget.js'></script>
<script src='/static/presentation/js/lib/jquery.iframe-transport.js'></script>
<script src='/static/presentation/js/lib/jquery.fileupload.js'></script>
4

3 に答える 3

25

わかりました、私はそれを理解しました。jquery.fileupload.jsafterjquery.ui.widget.jsとを含めるだけですjquery.iframe-transport.js。少なくとも私は将来の参考のために知っています。

<script src='/static/presentation/js/lib/jquery.ui.widget.js'></script>
<script src='/static/presentation/js/lib/jquery.iframe-transport.js'></script>
<script src='/static/presentation/js/lib/jquery.fileupload.js'></script>
于 2012-11-02T00:14:15.367 に答える
0

Make sure you are running complementary versions of jQuery and jQuery UI, and only one copy of jQuery. I realized I had jquery-rails running at 1.10 and a local jQuery 1.11 file, and removing the latter and upgrading the former did the trick.

于 2015-01-27T21:08:59.787 に答える
-1

With the newest version blue imp I just change jquery.ui.widget.js with jquery-ui-1.9.2.custom.min.js and it work well. Hope this help someone stuck with this.

于 2013-11-11T10:28:50.890 に答える