Explicitly set mime type for js file served as template
Better way to get the loading gif, also for issue #1537