Javascript 为什么玉有时会露出头来?
我有一个使用Jade的nodeJS web应用程序。有时*加载时,我会在Jade模板的头部部分配置一些头部内容,这些内容不应该显示,我希望看到的只是身体内容 以下是使用的Jade配置:Javascript 为什么玉有时会露出头来?,javascript,html,node.js,pug,Javascript,Html,Node.js,Pug,我有一个使用Jade的nodeJS web应用程序。有时*加载时,我会在Jade模板的头部部分配置一些头部内容,这些内容不应该显示,我希望看到的只是身体内容 以下是使用的Jade配置: doctype html html head base(href=config.suffixHostPath) title= title meta(name="google-site-verification" content="xMnXgGQJouIg4Og9hQUMHwXwaVlM
doctype html
html
head
base(href=config.suffixHostPath)
title= title
meta(name="google-site-verification" content="xMnXgGQJouIg4Og9hQUMHwXwaVlMQ0dFxDv4g_N3iOo")
script(type='text/javascript').
// If no https and https is required or no suffixHostPath and suffixHostPath is defined and
// if not in Studio, redirect the user.
var suffixRegExp = new RegExp('!{config.suffixHostPath}(\/+|$)');
if (((window.location.protocol === 'http:' && '!{config.supportHttps}' === 'true') ||
('!{config.suffixHostPath}' && !suffixRegExp.test(window.location.href))) &&
'!{config.client}' !== 'studio') {
window.location.href = '!{config.hostname}' + '!{config.suffixHostPath}' + (window.location.hash ? window.location.hash : '#!/');
}
link(rel="stylesheet" type="text/css" href=stylesUrl)
each url in dependencies
script(src=url)
script(type='text/javascript').
(function(angular) {
angular.module('app')
.constant('myConfig',
!{JSON.stringify(config)}
);
})(window.angular);
// After all scripts loaded, override repo_host if in Studio.
if ('!{config.client}' === 'studio') {
window.repo_host = window.location.protocol + '//' + window.location.host;
}
body
#my-app(ng-app='app')
div(ui-view)
这种不适当的做法从应用程序中配置的属性的映射开始,然后继续在Jade配置中放置部分脚本:
});})(window.angular); // After all scripts loaded, override repo_host if in Studio. if (" === 'studio') { window.repo_host = window.location.protocol + '//' + window.location.host; }
*它只是以某种随机的方式出现过几次
有什么想法吗?谢谢 欢迎光临。你能告诉我在显示标题内容时会产生什么类型的标记吗?我刚刚用这些信息更新了这个问题。谢谢你的欢迎!