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

Javascript popup window refresh'ing?

I have a page that automaticly opens a small popup window, but it is
only supposed to open this window once. A little info:

function openwindow(name_var) {
if (!name_var) {
name_var = window.open(...);
}
}

First of: Is that at all posible? To have a variable that holds the
name of the new window, and if that variable is not set, then open the
window, and will the new window opened have the name of the content of
the variable (confused? so am I)...

OR:

Can I, in the new window, do so it is imposible to refresh that
window, 'cause it refreshes when the top function tries to open it
again...?

Hope this was enough info, otherwise I'd be glad to write some more...

Hopefully I can get som help on this topic.

Thank's in advance.

- Jeppe
Jul 23 '05 #1
3 3121
Not exactly sure what your asking, but if you have a window open and then
open another window with the same name, it will put the new page in the
window with the same name . If there is not a window with that name, it will
create a new one.

"Jeppe bob Dyrby" <je***@yfu.dk> wrote in message
news:b5*************************@posting.google.co m...
I have a page that automaticly opens a small popup window, but it is
only supposed to open this window once. A little info:

function openwindow(name_var) {
if (!name_var) {
name_var = window.open(...);
}
}

First of: Is that at all posible? To have a variable that holds the
name of the new window, and if that variable is not set, then open the
window, and will the new window opened have the name of the content of
the variable (confused? so am I)...

OR:

Can I, in the new window, do so it is imposible to refresh that
window, 'cause it refreshes when the top function tries to open it
again...?

Hope this was enough info, otherwise I'd be glad to write some more...

Hopefully I can get som help on this topic.

Thank's in advance.

- Jeppe

Jul 23 '05 #2
Hmm... I wasn't totally clear then :p
Is there any way to stop the browser from openening a popup with the
same name as one that already exists?
If, for example: The opener window tries to open a popup window, but
there's already one with the same name, as the one it tries to open,
can I stop it from openening the same page in the same popup window?

- Hope that was a bit more info... :)
- Jeppe

"Camazing.com" <no****@camazing.com> wrote in message news:<Qu********************@adelphia.com>...
Not exactly sure what your asking, but if you have a window open and then
open another window with the same name, it will put the new page in the
window with the same name . If there is not a window with that name, it will
create a new one.

Jul 23 '05 #3
Jeppe bob Dyrby wrote:
Hmm... I wasn't totally clear then :p
Is there any way to stop the browser from openening a popup with the
same name as one that already exists?
Broadly no, in a practical sense, yes. That is, if you opened the
windows and gave them names then you are in a potion to record what you
have done and examine the references to those windows to see if they
have been closed or are still open, and make decisions about how to act
based on that information. However, if a window with an identical name
has already been created (say by a previous page/site) then you will not
know anything about it (and probably won't care much either).
If, for example: The opener window tries to open a popup window, but
there's already one with the same name, as the one it tries to open,
can I stop it from openening the same page in the same popup window?
Yes.
- Hope that was a bit more info... :)


It is more information, but whether it is enough information is another
matter. People write code to specifications, which are specific. If you
want to be told how to do something you will have to try to be specific
about what it is you want to do (and probably why). As it is, we get to
the point of determining that a window with a given name has been opened
and a URL loaded, and determine that it is still open, and so "stop it
from openening the same page in the same popup window", but does that
mean that the code is expected to just do nothing, or is the idea to
open a new URL in a distinct window?

But opening pop-up windows is not necessarily that good an idea to start
with due to the existence of diverse pop-up blocking mechanisms. Some
idea of the context of the application would allow for an assessment of
the significance of pop-up blocking (and accompanying required
additional testing) along with the proposition of alternative
approaches.

<snip top-post>

Please don't top post to comp.lang.javascirpt (see the FAQ).

Richard.
Jul 23 '05 #4

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

Similar topics

4
by: fartsniff | last post by:
Hello all. Can someone help out ? I found this PHP code that works just fine, however, I am trying to put it back into its original Javascript form. I am still learning the syntax, etc. for...
26
by: Raffi | last post by:
Hi, We have a database application that runs in a popup Internet Explorer application window. The reason for this is to isolate the casual user from the address bar and the typical IE navigation...
6
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
14
by: daveyand | last post by:
Hey guys, I've spent abit of time searching th web and also this group and cant seem to find a solution to my issue. Basically i want to get the current url, and then replace http:// with...
10
by: Martin Eyles | last post by:
Hi, I am getting a string passed back from a web form in the format name1:variable1;name2:variable2... I would like to split this up into several variable, such that the variable names are...
28
by: Noone Here | last post by:
AIUI, it was not all that long ago when the threat to personal users, was attachments that when executed compromised machines with keyloggers, trojans, etc. Now it seems that the big problem is...
7
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script...
1
by: Oren | last post by:
Hi, I need to know how much time has left from this meta: <meta id="ref" http-equiv="refresh" content="300;url="/> any idea ?
1
by: HopfZ | last post by:
Is it possible to open an external page in background? window.open('http://www.google.com/search?q='+Math.random()); window.focus(); I tried the above code in three browsers: Firefox 2 -...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.