Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在jade中,当包含在脚本中时,无法使include起作用_Node.js_Templates_Pug - Fatal编程技术网

Node.js 在jade中,当包含在脚本中时,无法使include起作用

Node.js 在jade中,当包含在脚本中时,无法使include起作用,node.js,templates,pug,Node.js,Templates,Pug,在模板中,包括正常工作,但在此脚本部分中除外: block head2 title Some Title script function pageInit() { include restful.js restful.init(); } document.addEventListener('load',pageInit) 区块头2 头衔 剧本 函数pageInit(){ 包括restful.js restful.init(); } doc

在模板中,
包括
正常工作,但在此
脚本
部分中除外:

block head2 title Some Title script function pageInit() { include restful.js restful.init(); } document.addEventListener('load',pageInit) 区块头2 头衔 剧本 函数pageInit(){ 包括restful.js restful.init(); } document.addEventListener('load',pageInit)
include restful.js
以直接脚本的形式出现——jades不执行include


如何获取
pageInit()中包含
转储行?

我相信,这样的操作一定不是模板引擎的工作,而是资产管理器的工作

无论如何,这感觉是错误的,但仍然有效:

//- somewhere in head
| <script>
include ../public/javascripts/log.js
| </script>
//-头上的某个地方
| 
包括../public/javascripts/log.js
|