Normally, a .js
file is referenced from HTML by a <script> tag. This serves two useful purposes that I can see:
B) It allows the browser to cache that file just like it can cache HTML so that the whole file doesn't need to be retrieved every time a page is loaded that uses it. This results in a faster page load.
Answers to your questions:
1) You could certainly put ASP <%...%> in a .js
file, but it would not get processed by the ASP engine (unless you modified the configuration on IIS to process JS
3) What do you mean the syntax is different? Isn't it still ASP code? What could you put between <% %> that isn't ASP?
Work smarter, not harder