mercredi 1 octobre 2014

[NodeJs][JavaScript]how to run server side script in html page


Vote count:

0




Hi im super new to javascript/node.js and need help running a server on localhost... I can run a basic server but I need to run a script with the webpage as well...


my hello.js file: var fs = require('fs'); var array = fs.readFileSync('songs/sister_golden_hair.txt').toString().split("\n"); for(var i in array) { document.write(array[i] + "<br>"); }


Is there anyway to run the js file in an html page without using express?


thanks.



asked 1 min ago







[NodeJs][JavaScript]how to run server side script in html page

Aucun commentaire:

Enregistrer un commentaire