Search code examples
javascriptasp-classicwindow.open

JavaScript window.open() a page with loads of scripts on it - scripts shown like text


I am working on a legacy Classic ASP system. In there, there is a a bit of JavaScript that opens a certain .asp file via a pop-up with the use of JavaScript's window.open().

The Classic ASP page that opens has in it a lot of JavaScript functions inside script tags. When this page is accessed via a URL, all is fine, the JavaScript is hidden like you would expect, but when I go to the same page via the window.open() route, I get something like this (note bottom edge):

javascript printed as text

As you can see, the javascript is all visible, when it should be hidden since it all sits in <script> tags.

The code calling the window.open() is as follows:

<tr class='rowAlt' 
    height="15" 
    onClick="window.open(intranetPath+'/forms/<%=taskForm %>?taskReporting=true&uniqueId=<%=myRs("UNIQUE_ID")) %>', 
    'view_event', 
    'width=890, height=600, status=no, resizable=yes, scrollbars=1');" 
    onMouseOver="this.className='rowHighlighted'" 
    onMouseOut="this.className='rowAlt'">

Firefox and Chrome hide the script tags. It is only IE that is messing up!

How do I overcome this issue?


Solution

  • It turns out that Tim Williams was correct. The page markup was messed up, it was a legacy system, and mu guess is that the person who coded it probably did not know what 'HTML Standards' were.

    Thanks Tim.