Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am running IE 9. Up until last week sometime, if I would put the URL of a JavaScript file in the address bar, it would show the JavaScript as text in the browser window. Now when I do that, it wants to download the JavaScript file.

How can I revert it to the previous handling?

This is annoying since I'm developing a web application and if I can get it to display the .js files as text in the browser, then I can refresh it to force the cache to update.

Update: I've tested on several co-workers machines. For some, browsing to .js files renders them in the browser (IE 9 in all cases). In others, it asks for a download. File associations don't seem to have any effect. One co-worker we tested with IE and Chrome. IE wanted to download it, but Chrome rendered it as text. This makes me think it's an IE issue and not an OS issue.

share|improve this question
    
Perhaps if you shared the URL we could give a better answer? –  Julian Knight Dec 17 '12 at 21:04
    
The Javascript file is on my machine. I do web development. Here's the URL: localhost/georgescript.js I don't think that's going to help you solve my problem, though. –  Pete Dec 17 '12 at 21:15
    
Actually it does help slightly - it does tell me you are running a local web server. Doesn't look like it works in IE10 either. In fact, you end up with about 5 or 6 clicks before you get anywhere. Though that was from a random web page on the web. It's not an answer but I'd choose a more developer friendly browser!! ;) –  Julian Knight Dec 17 '12 at 21:45
    
I am running a local web server but as far as the problem is concerned, it doesn't matter if I choose a localhost javascript file or a javascript file from any external web site. The problem is the same. –  Pete Dec 17 '12 at 22:15
1  
@Karan, that link gave me the answer. I simply added a key in the MIME content type database for application/x-javascript (there wasn't one, not sure if there should be or not) and set the CLSID string to "{25336920-03F9-11cf-8FD0-00AA00686F13}" which says it's an HTML document, restarted my browser, and it worked (Javascript still appears to execute fine on web pages as well). If you'll post that as an answer, I'll check it off. Thanks! –  Pete Dec 18 '12 at 13:54

2 Answers 2

up vote 1 down vote accepted

Try adding an entry for JS files to the MIME type database in the registry via the following .REG file (courtesy Cheeso's answer here):

Windows Registry Editor Version 5.00
;
; Tell IE to open JS documents in the browser.
; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the "Browse in place".
;

[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/x-javascript]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Encoding"=hex:08,00,00,00
share|improve this answer

If you are really just trying to manually recache the js file, you could just go to the page using the script file and press CTRL + F5 to empty the cache and redownload all files from that site.

If I go to a Javascript in IE 9 it'll ask me where to save the file.

share|improve this answer
    
Well, in addition to being able to refresh, it's simply handy for me to see what version of the .JS it's using. Yes, I can F12 it, but I can also F12 to refresh the .js. What I want is to fix it back to the way it was because that was the most effecient way for me to work. –  Pete Dec 17 '12 at 21:13
    
Well, I have to agree with Julian Knight, commenting on the question. I'd rather go with a more developer-friendly browser such as Google Chrome or Mozilla Firefox. It sounds as if this was done by an update to IE in general, seeing IE 10 does the same as 9. Microsoft is trying hard to turn the developers to IE, but it's not working. Their functionality is severely limited. By the way, you can do exactly the thing you are talking about in Firefox, not sure about Chrome. –  Time Sheep Dec 17 '12 at 21:57
    
Unfortunately we develop for IE only as it's the company's choice of browser (certainly not mine). And this is not an update/version issue (see my update. We compared version numbers and revisions). –  Pete Dec 17 '12 at 22:12
    
Yes, exactly. I too, was trying to open a .js file in IE 9 resulting in a downloaded javascript. This is an interesting issue, but I'm out of ideas then. –  Time Sheep Dec 17 '12 at 22:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.