When editing JavaScript inside a script tag the syntax highlighting is much better than when editing myFile.js.
Is there a way to have the same syntax highlighting in a separate file as you have inside a script tag?
I already tested both the stock javascript.vim syntax file and this alternative one: http://www.vim.org/scripts/script.php?script_id=1491!
edit: please check screen shot:

Left side is inside script tags and :setfiletype html. Right side is plain javascript with :setfiletype javascript