static javascript not rendering in jade (with express/node.js)

前端 未结 4 529
误落风尘
误落风尘 2021-01-19 14:43

I hope you are well.

I\'m suddenly unable to render any external javascript in jade templates! To get to the bottom of things, I stripped it down to the bare minimum

4条回答
  •  清酒与你
    2021-01-19 14:50

    Why do you have a beginning forward slash '/' in your Jade script tag? With your script in /public/javascripts/script.js, the correct way to reference it in Jade is script(src="javascripts/script.js"). At least that is what is working on my installation. The same is true for other assets like CSS or images in the /public directory.

提交回复
热议问题