作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个来自 Google 的 .html 文件,我需要在 http://www.domain.com/google1234567890123456.html
上提供该文件。我将 .html 文件放入 pathToMeteorApp/public/
但是当我访问该 URL 时,Meteor 为我提供了一个带有一些模板的空白页面。
我正在使用 iron-router
,那么即使 .html 文件位于公用文件夹中,路由器是否仍在管理 .html 文件的 url?如果是这样,我们如何防止这种情况发生并直接在该网址提供 .html 文件?
最佳答案
我会尝试创建一条路线:
Router.map(function() {
this.route('google', {
path: '/google1234567890123456.html'
});
});
和模板:
<template name="google">
<!-- Your google1234567890123456.html content in <body></body> here -->
</template>
如果它包含任何脚本,您可以在渲染函数中执行它们:
//client code
Template.google.rendered = function() {
//execute google scripts
}
关于javascript - Meteor.js 公用文件夹不提供 .html 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20510745/
我是一名优秀的程序员,十分优秀!