This is a weird one. I have devised a minimal web page http://localhost/Default.htm on a Windows 10 IIS server that demonstrates the error.
<!DOCTYPE html>
<html>
<head>
<script src="script.js"></script>
<link href="script.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<script>
document.writeln("Got my ");
</script>
web page content
</body>
</html>
The one line script.js consists of
alert('x');
The css file is
body {
font-family: arial;
}
The jquery link is to check external sources.
On Chrome the page loads and then downloads the 3 files. The page shows
Got my web page content
The alert did not show and the css styling did not work
The JQuery script is OK. The script.js file throws an error
Uncaught SyntaxError: Invalid or unexpected token
The response is surprising
污牥⡴挧⤧
The response headers look OK
HTTP/1.1 304 Not Modified
Accept-Ranges: bytes
ETag: "f4cca4492325d41:0"
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Date: Thu, 26 Jul 2018 23:49:32 GMT
Chrome throws a second error for the in-page-script.js. This is a plugin for Ember.js
Uncaught SyntaxError: Invalid or unexpected token
The content is lots of
⨯ਪ⨠吠敨䌠牨浯湡楆敲潦⁸硥整獮潩獮椠橮捥⁴桴湩瀭条ⵥ捳楲瑰椠瑮桴...
The script.css file is similar
潢祤笠††潦瑮昭浡汩㩹愠楲污഻紊
Now if I load the files individually in the same chrome browser (in Developer Tools > Network > right click on script.js and Open in a new window)
They are correct. It issue only seems to be apparent with page linked files.
FireFox loads all the files but throws similar errors as Chrome
SyntaxError: illegal character[Learn More] script.js:1:2
The response is
alert('x');
IE and Edge just work and don't have any issues (I never thought I'd say that) with this page.
Remedial actions I've played around with Application Pools, encodings, cachings, disk encryption, mime types. Nothing I have tried works. I think I have corrupted IIS some how in working with iisnode as this is the second IIS server that has had the same issue. The earlier server affected all web browsers equally resulting in the same Chinese/Korean/Japanese characters.
I'm at a loss. Any clues would be helpful