Can’t run server-side Javascript on Classic ASP

asp-classiciis-7.5javascript

I'm trying to run a server side piece of JavaScript code on my ASP site. The whole site is using VBScript, but this piece is written in JavaScript, so I'm using a separate tag, rather than setting the language at the top of the page. This works perfectly on my local IIS Express, as well as on other servers' IIS (with no additional config), but fails on my local IIS, saying "An unhandler exception occured".

I suspect that it's a broken installation — although I did everything by the book when enabling Classic ASP support, I had to manually register the required modules and handlers, even for static content support. Could it be that I'm missing something in my server configuration?

Here's the failing code:

<script language="Javascript" runat="server">
 var x;
</script>
===

If I remove the var x; line, the error goes away.

Best Answer

Although I tried to resolve this for a couple of days, I finally fixed it a few minutes after I posted this question.

Opened the console as admin, ran regsvr32 jscript.dll, restarted IIS. That did it.