Help with Javascript/Popup

Can anyone please help me understand why having script tag in the text passed to the window.write method doesn't work. I have the following html which I need to put that into a new popup

<HTML> <BODY><SCRIPT></SCRIPT><FORM><INPUT TYPE=&quot;hidden&quot; NAME=&quot;remoteSessionId&quot; VALUE=&quot;00002Er6QYYLNynw7O0aXnlh1mh:10uaq7rrh&quot;><INPUT TYPE=&quot;hidden&quot; NAME=&quot;pageName&quot; VALUE=&quot;Inbox&quot;><INPUT TYPE=&quot;hidden&quot; NAME=&quot;eventName&quot; VALUE=&quot;InboxRSEvent&quot;><INPUT TYPE=&quot;hidden&quot; NAME=&quot;marker&quot; VALUE=&quot;URL&quot;> </FORM> <!-- URL --> </BODY> </HTML>

I'm doing a window.Open and using Window.Write(<above htmlt>)
Its working fine if I remove the <script></script> tags, but I need to have them as I've got a js function in the above html. Can anyone suggest me a workaround or a fix for this please....
pnadakuditiAsked:
Who is Participating?
 
Lo-TanCommented:
Take note of how I display the pop up and write to it.

You must close the document as well or else the web page keeps waiting for more information instead of closing the stream.

<html>
  <head>
      <title>Test Popup</title>
      <script type="text/javascript" language="JavaScript">
      <!--
      function showPopUp () {
        var myWindow = window.open ("","My Popup");
        myWindow.document.write ('<HTML><SCRIPT></SCRIPT><BODY><FORM><INPUT TYPE=&quot;hidden&quot; NAME=&quot;remoteSessionId&quot; VALUE=&quot;00002Er6QYYLNynw7O0aXnlh1mh:10uaq7rrh&quot;><INPUT TYPE=&quot;hidden&quot; NAME=&quot;pageName&quot; VALUE=&quot;Inbox&quot;><INPUT TYPE=&quot;hidden&quot; NAME=&quot;eventName&quot; VALUE=&quot;InboxRSEvent&quot;><INPUT TYPE=&quot;hidden&quot; NAME=&quot;marker&quot; VALUE=&quot;URL&quot;> </FORM></BODY> </HTML>');
        myWindow.document.close ();
      }
      -->
      </script>
  </head>
  <body>
      <input type="submit" value="Open Popup" onclick="javascript: showPopUp();"/>
  </body>
</html>
0
 
raj3060Commented:
Move script inside HEAD tags..
0
 
pnadakuditiAuthor Commented:
tried moving into head tags...it didnt work....
0
 
raj3060Commented:
Not too different from above:

But you need to use document.write..
Instead window.write...
0
 
Lo-TanCommented:
Can you tell me what the solution required to have been warranted an A?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.