473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to display "please wait.." after new window opens


Hi

I have a form that opens a new window for the results. Because the results
might take a few seconds due to server processing, I would like to display
a message "please wait" in the new window, erase that message when the
processing is done and show the results.

How is this done?

John Dalberg
Jul 23 '05 #1
3 4591
John Dalberg wrote:
Hi

I have a form that opens a new window for the results. Because the results
might take a few seconds due to server processing, I would like to display
a message "please wait" in the new window, erase that message when the
processing is done and show the results.

How is this done?

John Dalberg


Hi,
Open a named window with a static page eg. wait.html (with the word
"Please wait..." on it)
The use windowName.document.write(Results) to replace the static page
with results.

Kien
Jul 23 '05 #2
On Wed, 04 Aug 2004 20:38:13 GMT, Kien wrote:
John Dalberg wrote:
Hi

I have a form that opens a new window for the results. Because the results
might take a few seconds due to server processing, I would like to display
a message "please wait" in the new window, erase that message when the
processing is done and show the results.

How is this done?

John Dalberg


Hi,
Open a named window with a static page eg. wait.html (with the word
"Please wait..." on it)
The use windowName.document.write(Results) to replace the static page
with results.

Kien


It doesn't work for me. This is what I am doing. You can view the
javascript, form and the button.

<SCRIPT LANGUAGE="JavaScript">
<!--
var msgWindow;
var sResults;
function newWin(){
sResults = QueryResults;
strFeatures='resizeable=no,width=800,height=600';
msgWindow=window.open('wait.htm','',strFeatures);
msgWindow.document.write(sResults)
msgWindow.focus();
}

This is the form:
<form Method="get" name="frmDomainCheck" action="whois.asp"
target="QueryResults">

This is the button:
<input type="submit" value="Check For Availability" class="whois"
onclick="newWin();return true">

J.
Jul 23 '05 #3
John Dalberg wrote:
Hi

I have a form that opens a new window for the results. Because the results
might take a few seconds due to server processing, I would like to display
a message "please wait" in the new window, erase that message when the
processing is done and show the results.

How is this done?

John Dalberg


-- on the page used to initate generation of the report:

<input type="submit" value="Generate Report" onclick="openStatusWindow();">
<script type="text/javascript">
function openStatusWindow() {
if (window.open) {
var throwAway = window.open(
'status.html',
'statusWindow',
'width=400,height=200'
);
}
}
</script>

-- status.html:

<html>
<head>
<title>Generating report... please wait</title>
<script type="text/javascript">
function holdFocus() {
var t = setTimeout(holdFocus, 1000);
window.focus();
holdFocus.toString = function() {
return 'holdFocus();';
}
}
</script>
</head>
<body onload="holdFocus();">
<p align="center">Generating report... please wait</p>
</body>
</html>

-- on the page containing the resulting report:

<body onload="closeStatusWindow();">
<script type="text/javascript">
function closeStatusWindow() {
if (window.open) {
var w = window.open(
'about:blank',
'statusWindow',
'width=400,height=200'
);
if (w && !w.closed) {
w.close();
}
}
}
</script>

It's necessary to call window.open() again on the window named "statusWindow".
If you do not, you will not have a reference (handle) to it, and will not be
able to close it. I tested it in IE6SP1, Netscape 4.78, Firefox 0.9.2 and
Opera 7.53 and it allowed me to open and close the window without holding a
reference to it.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: mvr | last post by:
Hi all Can some one give me a sample code to display a "please wait" message while retrieving results from the database in ASP. Thanks mvr
3
by: Kannan | last post by:
Hello, I have a requirement that specifies that I display a "Please Wait..." window (preferably modal) along with a gif that mimics a progress bar during a save operation. The dialog needs to be...
1
by: metsymani | last post by:
In my web application, I have a search screen coded in ASP.Net. The Search process takes lot of time. So, I need to show a wait page informing the user that "Search is in progress. Please wait" along...
1
by: Paul | last post by:
Hi I have a pretty simple VB.NET which contains some dropdown lists, a QUERY button, UPDATE button and datagrid. The page works great accept sometimes the database access behind the QUERY and...
9
by: John Walker | last post by:
Hi, I have a datagrid with a radiobutton template column, with AutoPostBack set to TRUE. When the user clicks on a radiobutton the application will PostBack, and in the PostBack there will be...
3
by: Ben Fidge | last post by:
Hi Our app performs a quite lengthy process when the user clicks a button. We'd like to display a little pop-up "Please Wait..." notification using an animated gif. How would I go about this?...
5
by: Jeremy | last post by:
Hi all, I have database actions that will potentially take several seconds to complete. My normal page uses AJAX so keeping the user informed of what is happening is not a problem. ...
2
by: ccbryan | last post by:
I have Googled and Googled, but I only find explanations of this for ASP.NET, etc. How do you put up a 'please wait' window at the beginning of a process and close it at the end of the process in a...
1
by: =?Utf-8?B?Sm9obiBXYWxrZXI=?= | last post by:
Hi, I have a webpage designed with asp.net 2.0. Is there a way to display a "please wait" message to the screen horizontally centered and veritcally 20px from the VISIBLE top of the page,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.