1)我的索引页面有ejs:
<%include ../includes/layout.ejs %>
<h1>This is the index page, did layout come along?</h1>
Run Code Online (Sandbox Code Playgroud)
2)我的ejs布局页面:
<!DOCTYPE html> <html>
<head>
<title>MultiVision</title>
<% include ../includes/styles.ejs %>
<script type="text/javascript" rc="/vendor/jquery/dist/jquery.min.js"></script>
</head>
<body>
<%include ../includes/scripts.ejs%>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
3)我的脚本页面与ejs:
<script src="/vendor/bootstrap/dist/js/bootstrap.js" type="text/javascript"></script>
<script src="/vendor/toastr/toastr.js" type="text/javascript"></script>
<script src="/vendor/angular/angular.js"type="text/javascript"></script>
<script src="/vendor/angular-resource/angular-resource.js" type="text/javascript"></script>
<script src="/vendor/angular-route/angular-route.js" type="text/javascript"></script>
<script src="/app/app.js" type="text/javascript"></script>
Run Code Online (Sandbox Code Playgroud)
但是,我始终会为每个脚本标记收到此错误:
Uncaught SyntaxError: Unexpected token < ######.js
Run Code Online (Sandbox Code Playgroud)
将它们更改为cdn位置虽然有效,但这不是我想要的.
小智 5
我想如果我把它包含在我的server.js中会有所帮助:;)
Run Code Online (Sandbox Code Playgroud).... , path = require('path'), ..... app.use(express.static(path.join(__dirname, 'public')));
| 归档时间: |
|
| 查看次数: |
6233 次 |
| 最近记录: |