在另一个文件中包括一个ejs文件,好像在粘贴了
我有两个EJS文件(在同一dir index.ejs& amp; window.ejs中。 我尝试将窗口包括在索引中,并使用窗口中定义的功能,并且它无法使用。但是当我将window.ejs粘贴到索引中而不是
中 <% - 包括(“ ./ window.ejs”)%>它突然开始工作。
为了使问题显而易见,我没有错误的错误,例如“ functiNName n's deleder”,“ functionName in notect of cogoginz over ogginz offect''。
我还尝试了使用“ =”,“”的EJS标签,但仍然没有结果
i have two ejs files(in same dir index.ejs && window.ejs).
i tried to include window in index and use function that is defined in window and it wont work. but when i paste window.ejs content in index instead of
<%- include("./window.ejs")%> it suddenly starts working.
to make problem apparent i don't have error like "functinName is not decleared","functionName was not recoginzed".
i also tryed ejs tags with "=","" but still no result
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
删除“ ./”似乎对我有用。
Try:
Removing the "./" seemed to work for me.