문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top