我正在尝试使用sails.js和Zurb Foundation 6.2。我用这个方便的npm generator来设置我的笨拙任务。输出看起来不错。我有一个包含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,但仍无法使其正常工作。
感谢您的帮助。
答案 0 :(得分:5)
Foundation目前不兼容jQuery 3.0.0,Foundation使用已弃用的jQuery.fn.load()
。现在使用jQuery 2.2.x.请参阅问题和PR: