In the .js file add the following to the top and bottom of the file:
//<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><script type="text/javascript"> … //</script></head><body></body></html>
And then in Tools -> Options -> File Extentions map js to the HTML editor:
