sails.js and foundation 6 - TypeError: url.indexOf is not a function

sails.js and foundation 6 - TypeError: url.indexOf is not a function

我正在尝试使用 sails.js 和 Zurb Foundation 6.2。我使用这个方便的 npm generator 来设置我的 g运行t 任务。输出看起来很不错。我有一个包含 jquery、foundation 等的 js 文件

在我的 layout.ejs 中,我有这个:

<!DOCTYPE html>
<html>
  <head>
    <title><%=typeof title == 'undefined' ? 'New Sails App' : title%></title>

    <!-- Viewport mobile tag for sensible mobile support -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!--STYLES-->
    <link rel="stylesheet" href="/styles/app.css">
    <!--STYLES END-->

  </head>


  <body>
...  some html ...
    <%- body %>

    <!--SCRIPTS-->
    <script src="/js/dependencies/sails.io.js"></script>
    <script src="/js/dependencies/foundation.js"></script>
    <!--SCRIPTS END-->
     <script>
            $(document).foundation();
        </script>
  </body>

</html>

当我 运行 页面时,我得到这个错误:

**TypeError: url.indexOf is not a function
jQuery.fn.load()
 foundation.js:9612
<anonymous>
 foundation.js:11913
<anonymous>**

我对此的阅读表明,问题是某些内容未加载、加载不止一次或顺序错误。我该如何缩小范围?我尝试为每件作品使用 CDN,但仍然无法正常工作。

感谢您的帮助。

Foundation 目前与 jQuery 3.0.0 不兼容,Foundation 使用的是已弃用的 jQuery.fn.load()。现在使用 jQuery 2.2.x。查看问题和 PR:

https://github.com/zurb/foundation-sites/issues/8834

https://github.com/zurb/foundation-sites/pull/8923