【问题标题】:jquery.fileupload.js:87 Uncaught TypeError: $.widget is not a function on jQuery-file-uploadjquery.fileupload.js:87 Uncaught TypeError: $.widget is not a function on jQuery-file-upload
【发布时间】:2015-04-20 04:23:35
【问题描述】:

我尝试将basic 示例(source)用于jquery-file-upload,我包含在我的html 中的文件是:

jquery.js
bootstrap.css
bootstrap.js

jquery.fileupload.css
jquery.iframe-transport.js
jquery.fileupload.js

为了正确使用jquery-file-upload,还有什么我应该包括的吗?

我的应用不需要使用jquery-ui。 如果jquery-ui 确实是jquery-file-upload 的依赖项,是否有任何解决方法可以在没有jquery-ui 的情况下使用它?

【问题讨论】:

    标签: javascript jquery file-upload jquery-file-upload


    【解决方案1】:

    没关系,我应该先阅读this。只需要jquery-ui.widget.js,而不是整个jquery-ui

    【讨论】:

      【解决方案2】:

      顺序

      <script src="js/vendor/jquery.ui.widget.js"></script>
      <script src="js/jquery.iframe-transport.js"></script>
      <script src="js/jquery.fileupload.js"></script>
      

      加载也很重要。

      【讨论】:

        【解决方案3】:
        jquery.js
        jquery.ui.widget.js
        jquery.iframe-transport.js
        jquery.fileupload.js
        

        最后

        $('#input').fileupload() // and U is lower case !!!!
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2012-05-12
          • 2017-08-01
          • 2016-07-07
          • 1970-01-01
          • 1970-01-01
          • 2021-04-26
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多