View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
I dont' understand why you would need to dynamically create an FWX file.  Why not have a standard FWX file that dynamically creates HTML output, based on the data in RECORDS.DBF?
 
Also, what's the reason for opening a separate window to display page_3.fwx, if you are going to close the current window anyway?  Why not display the results in the current window?
 
In any case, if you want to close the current window right after you open the new window, you can simply use the window.close() method:
 
<BODY onLoad='window.open("page_3.fwx","1"); window.close()'>
 
Note that, unless the current window was opened programatically, the browser will ask you to verify that you want to close it.
 

FoxWeb Support Team
support@foxweb.com email

Sent by Gene Gerard on 10/16/2002 12:25:49 PM:

How Do I Automatically Close A Window That's No Longer Needed?

I'm using a combination of Javascript and FoxWeb with the following methodology.


Step 1 - a button is clicked on 'PAGE_1.FWX' (html type)

Step 2 - a link is performed to 'PAGE_2.FWX' (html type)

Step 3 - FoxWeb script in 'PAGE_2.FWX' calls a function from a 'Procedure Library' program called 'PROCS.FXP' (prg type). This procedure dynamically

   a. creates 'PAGE_3.FWX' which is populated
      with data from 'RECORDS.DBF'

   b. linls to 'PAGE_3.FWX'

 

All this has been accomplished and works fine. The problem is that 'PAGE_2.FWX' is no longer needed. It is easy to put a text or button link on it to close the window but I would like this to occur automatically.

I've tried various variations of closing the screen, even with the timer but nothing has worked so far. Here's the working code in 'PAGE_2.FWX' :

<HTML><HEAD></HEAD>
<% =procs(1) %>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT></HEAD>
<BODY onLoad=window.open("page_3.fwx","1")>
</BODY></HTML>

I looked at the popup timer functions without success (this window is not a popup anyway). Can code maybe be put in 'PAGE_3.FWX'  that when loaded, would close 'PAGE_2.FWX' ?

Any ideas?

Gene