How do i write documents to same new window every

Results 1 to 2 of 2

Thread: How do i write documents to same new window every

  1. #1
    corner Guest

    Default How do i write documents to same new window every

    I am sorry to post javascript not ASP question...<BR>for example<BR><BR>function OpenWindow(filename)<BR>{<BR>window.open (filename,"WinName"); }<BR><BR>/*the first call,open one new window*/<BR>filename="abc.htm";<BR>OpenWindow(filename);<B R>...<BR>/*the second call,open one new window more again...*/<BR>filename="yyy.htm";<BR>OpenWindow(filename);<B R>...<BR>I want to open only one window,and all documents displayed at <BR>the same new winddow,how to do?<BR><BR><BR>

  2. #2
    MChance Guest

    Default RE: How do i write documents to same new window e

    You need to reference the window by name instead of calling the open window function. Do this instead:<BR><BR>function OpenWindow(filename)<BR>{<BR>window.open (filename,"WinName"); }<BR><BR>function loadToWindow(filename){<BR>WinName.location.href = filename;<BR>} <BR>/*the first call,open one new window*/<BR>filename="abc.htm";<BR>OpenWindow(filename);<B R>...<BR>/*the second call,open one new window more again...*/<BR>filename="yyy.htm";<BR>loadToWindow(filename); <BR><BR><BR>I&#039m assuming that you are calling to open the window from an HREF, and all subsequent loads from different HREFs. This also assumes that the first link will always be clicked to open the window the first time (i.e. your users will not click the second link first) otherwise you are going to have to test for the existance of a window named "WinName", and then call OpenWindow or loadToWindow depending on if it is there or not.<BR><BR>Hope this helps.<BR><BR>Mark Chance

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •