开发者

Loading jQuery with NodeJS

开发者 https://www.devze.com 2023-03-26 05:32 出处:网络
I have a working HTML file with some javascript in it. I use NodeJS to send it to the开发者_JS百科 client using fs.readFile() and response.write(). The problem with this is that, although the HTMLrend

I have a working HTML file with some javascript in it. I use NodeJS to send it to the开发者_JS百科 client using fs.readFile() and response.write(). The problem with this is that, although the HTML renders fine, the javascript (which includes jQuery) doesn't load.


You really shouldn't manually do "fs.readFile()" and "response.write()". Have a look at "lightnode" for serving static files: https://github.com/ngspinners/lightnode

0

精彩评论

暂无评论...
验证码 换一张
取 消