0

Hello I have a problem with a Javascript in a ASP web site, the problem is that the javascript contains multiple times the simbol "<%" and also "%>" and IIS or ASP interpret this as ASP code tag.

If you enter here: https://frank02.zip2tax.com/website/pagescountries/canada/index/canadamap.js

I am getting a Vbs error even when the file is a js which just need to be served. I have another server which has not this problem.

I think the server is interpretting this as an ASP tag but it does not an ASP tag this is part fo the javascript. before that "`" showing in the error there is a "<%" simbol. so I think it is try to execute ASP code :(.

Here is a portion of the code, and you will be able to see the <% simbol, all the file contains multiples "`" characters but just after that symbol I get the error.

Portion of code of the javascript which contains "<%" tag

In another server all runs OK: https://casper09.zip2tax.com/website/pagescountries/canada/index/canadamap.js

Please I need, I do not know if it is a server configuration or changes in the code.

1

1 Answer 1

1

I solved the problem, I found that the javascript contains the following character "<%" and that correspond to open tag for ASP code. Since my web application is an ASP web page the server interpreted that as ASP code, even the file was an javascript (*.js). The way I solve this was:

1) Right click on the corresponding application pool, and select advance settings. 2) On ".NET Framework version" change it to "4.0". 3) On "Enable 32 bits" I set to "True". 4) On "Managed Pipeline mode" I set "Integrated".

Once that was done I set/change this on web.config

<handlers accessPolicy="Read, Execute, Script">
        <add name="ASP-Classic-in-js" path="*.js" verb="GET,HEAD,POST" modules="IsapiModule" scriptProcessor="%windir%\system32\inetsrv\asp.dll" resourceType="Unspecified" requireAccess="Script" preCondition="bitness64" />
</handlers>

And after that, restart the application pool, and restart the website.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.