Pregunta

In some legacy Classic ASP code, we have the following:

    onClick="window.open(newIntranetPath + '/taskManagement/forms/<% =step1FileName %>?taskReporting=true&uniqueId=<% Response.Write(myRs("UNIQUE_ID")) %>','view_event','status=no,resizable=yes,scrollbars=1');"

The file that is being loaded into that Window.Open() function is one that has JavaScript code (between script tags of course). But when the page loads in the new window, all that JavaScript is loaded as text!

It is like the <script></script> tags are completely ignored!

enter image description here

¿Fue útil?

Solución

I suggest that instead of linking to a file directly, you link to an ashx handler file (passing the filename as a parameter) which gets the file and serves it with the correct mime type so that the browser knows what to do with it.

See this for setting up a generic file handler and this for setting the right mime types.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top