Mat*_*ght 5 sails.js zurb-foundation-6
我正在尝试使用sails.js和Zurb Foundation 6.2.我使用这个方便的npm生成器设置我的grunt任务.输出看起来不错.我有一个包含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>
Run Code Online (Sandbox Code Playgroud)
当我运行页面时,我收到此错误:
**TypeError: url.indexOf is not a function
jQuery.fn.load()
foundation.js:9612
<anonymous>
foundation.js:11913
<anonymous>**
Run Code Online (Sandbox Code Playgroud)
我对此的解读表明,问题是要么没有加载某些东西,要么加载不止一次,要么是错误的顺序.我该如何缩小范围?我试图为每件作品使用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
| 归档时间: |
|
| 查看次数: |
1268 次 |
| 最近记录: |