473,396 Members | 1,995 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,396 software developers and data experts.

window.open and settimeout

Michael Winter <M.******@blueyonder.co.invalid> wrote in message news:<op**************@news-text.blueyonder.co.uk>...
On 24 Feb 2004 14:13:47 -0800, John <jo******@fastermail.com> wrote:
I would like to use setTimeout and window.open methods to pop up
window every 5 minutes. I can only manage to make the window to pop up
only twice.

function openWindow() {
window.open("popupwindow.htm", "OpenedWindow",
"width=320,height=240, scrollbars=yes,resizable=yes,status=yes");

}
function settime() {
setTimeout("openWindow()", 300 * 1000);
}

So what is the problem that is making the window never to come back
when the user closes the popped window the second time?


The solution is simple, but first, I would like to know why you would want
to do something like this. It sounds remarkably like pop-up banner
behaviour.

Of course, I don't really care personally: Opera (my browser) blocks that
kind of pop-up. However, I would be concerned for other users, and I won't
endorse something so disruptive.

Mike

This is a friendly popup window that reminds a retailer that he has
not taken care of the orders that has come to his site. He has an
option for disabling the window and also if he takes care of the
orders the window will not pop up.

John
Jul 20 '05 #1
1 8694
On 25 Feb 2004 05:33:36 -0800, John <jo******@fastermail.com> wrote:
Michael Winter <M.******@blueyonder.co.invalid> wrote in message
news:<op**************@news-text.blueyonder.co.uk>...
On 24 Feb 2004 14:13:47 -0800, John <jo******@fastermail.com> wrote:
I would like to use setTimeout and window.open methods to pop up
window every 5 minutes. I can only manage to make the window to pop up
only twice.

function openWindow() {
window.open("popupwindow.htm", "OpenedWindow",
"width=320,height=240, scrollbars=yes,resizable=yes,status=yes");

}
function settime() {
setTimeout("openWindow()", 300 * 1000);
}

[snip]
The solution is simple, but first, I would like to know why you would
want to do something like this. It sounds remarkably like pop-up
banner behaviour.

[snip]
This is a friendly popup window that reminds a retailer that he has
not taken care of the orders that has come to his site. He has an
option for disabling the window and also if he takes care of the
orders the window will not pop up.


OK. That seems reasonable.

Instead of your setTimeout() call, use setInterval():

timerID = setInterval( openWindow, 300000 );

Where timerID is a global variable. You will need to use that with
clearInterval() when you want to stop the function, openWindow, from being
called - when the retailer disables display of the window, or when there
is nothing to remind him about, for example.

The difference between setInterval and setTimeout is that setTimeout fires
only once, whereas setInterval fires continuously (once every 5 minutes,
above) until it is cancelled with clearInterval.

Good luck,
Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #2

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

Similar topics

18
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page...
6
by: Les | last post by:
Hi, I'd like to find out how to use the window.open() script in Fireworks MX. I have posted my question in the Fireworks forum but didn't get any replies. Since it's javascript, maybe someone...
2
by: Richard Bell | last post by:
Newbie question ... please respond to group I'm trying to open/navigate to a url. How can I tell when the page is fully loaded? Testing suggest that window.open returns before the page is...
1
by: John | last post by:
I would like to use setTimeout and window.open methods to pop up window every 5 minutes. I can only manage to make the window to pop up only twice. function openWindow() {...
10
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a...
2
by: Samir Pandey | last post by:
Hello, I am using the following javascript code to open a new window. Somehow, IE always opens a new window. It doesn't open target url in the window name given. All i want is, if there is a...
13
by: MPH | last post by:
Problem: using a named window as target, a new window is opened anyway. Also, both windows have the same name. This happens on SOME machines only env: XP sp2 ie6.0.2900.2180 + sp2 ...
5
by: Andrea A | last post by:
Hi All. I need to read the TITLE of a window popup opened by a my page. I'm testing this code <SCRIPT> var a = window.open("http://www.pippo.com", "a");...
2
by: John Derry | last post by:
I'm having a curious problem. I open a window with window.open method and supply a url which is a local file of file:/// form. After that, I go into the document of this new window to read the DOM...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.