473,854 Members | 1,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How make so child window always has focus unless clossed?

I have a page that opens a child window using window.open(... ). How do
I make so that when that child window opens you cannot get the focus
back on the parent window unless you close the child window?

Is it even possible?

Sep 9 '05 #1
10 4327
CyberBless said the following on 9/8/2005 8:34 PM:
I have a page that opens a child window using window.open(... ). How do
I make so that when that child window opens you cannot get the focus
back on the parent window unless you close the child window?

Is it even possible?


No.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 9 '05 #2
CyberBless wrote:
I have a page that opens a child window using window.open(... ). How do
I make so that when that child window opens you cannot get the focus
back on the parent window unless you close the child window?

Is it even possible?


While such a thing is possible , I don't think that many folks
are going to want to tell you how, as while your intentions may be
honarable, the effect can and probably would be abused
by at least someone reading about it down the road.

Perhaps if you explained what you were upto , a suitable alternative
could be provided that would both address your needs and
avoid the potential frustrations and confusion a user would
experiance in having their browser "hijacked".

Seriously , I'm not trying to give you a hard time , but rather
trying to save both you and others some grief.
--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML/CSS,Javascript, TCP ...
--`
Sep 9 '05 #3

"CyberBless " <gr****@cyberbl ess.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
I have a page that opens a child window using window.open(... ). How do
I make so that when that child window opens you cannot get the focus
back on the parent window unless you close the child window?


use a modal dialogue box instead of a child window.
Sep 9 '05 #4
makes perfect sense. Now that you've mentioned it I can see how
something like that could be abused. The parent page is a allowing the
user to choose the products that he or she wants. Once the user is
ready to check out they click a button which runs window.open(). This
child window displays all the products in the users shopping cart and
asks for address, credit card info and so on.

The problem I'm having is If the user navigates back to the parent page
and adds more items to the cart then navigates back to the child page
it does not update. I want to force the user to have to close that
child window in order to get back to the parent page. This will force
the child page containing all the shopping cart info to have to update.
Any other suggestion you may have that alleviates this problem is
welcome. I have no issue with giving you the URL of the actuall
website if you contact me via email. gr****@cyberble ss.com.
Thanks
Cyber

Sep 9 '05 #5

"CyberBless " <gr****@cyberbl ess.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
makes perfect sense. Now that you've mentioned it I can see how
something like that could be abused. The parent page is a allowing the
user to choose the products that he or she wants. Once the user is
ready to check out they click a button which runs window.open(). This
child window displays all the products in the users shopping cart and
asks for address, credit card info and so on.

The problem I'm having is If the user navigates back to the parent page
and adds more items to the cart then navigates back to the child page
it does not update. I want to force the user to have to close that
child window in order to get back to the parent page. This will force
the child page containing all the shopping cart info to have to update.

use a modal dialogue instead of a new window. this will stay in the
forefront and prevent the user from minimising it ect, they only way for
them to get back to the main window will be to close it.
Sep 9 '05 #6
I'm not familiar with modal dialogues. Is it at all possible for you
to give me a hint on how to get started there.

Sep 9 '05 #7
CyberBless wrote:
makes perfect sense. Now that you've mentioned it I can see how
something like that could be abused. The parent page is a allowing the
user to choose the products that he or she wants. Once the user is
ready to check out they click a button which runs window.open(). This
child window displays all the products in the users shopping cart and
asks for address, credit card info and so on.

The problem I'm having is If the user navigates back to the parent page
and adds more items to the cart then navigates back to the child page
it does not update. I want to force the user to have to close that
child window in order to get back to the parent page. This will force
the child page containing all the shopping cart info to have to update.


Basicly the thought is that each time you add an item to the
cart , you update the invoice display at the same time, which
can be sorta entertaining in a strange kind of way.

You can test to see if your window variable is null and if not
you can check if the user has closed the window yourWindowVar.c losed
or such to see if indeed you need to bother displaying, but none the
less that would be the basic thought.

Just for fun heres a mockup sample of how I go about a javascript
shopping cart gizmo, but it does not employ a popup window at all.
http://www.drclue.net/projects/jsDHT...ppingCart.html

--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML/CSS,Javascript, TCP ...
--`
Sep 9 '05 #8
Thanks doc. Let me play with this for a while and see how and where I
can fit it into my site.

Sep 9 '05 #9
CyberBless wrote:
I'm not familiar with modal dialogues. Is it at all possible for you
to give me a hint on how to get started there.


Modal dialogs are not consistently supported across various browsers, a
better way is not to use a popup at all. Tabbed browsing allows users to
open their cart in a tab and so should update it whenever they choose.

Geko browsers support 'modal', as does IE 6.

<URL:http://groups.google.c om.au/group/comp.lang.javas cript/browse_thread/thread/abe7b75f612a4c6 9/c64dfc9d2689325 5?q=modal&rnum= 2&hl=en#c64dfc9 d26893255>

--
Rob
Sep 9 '05 #10

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

Similar topics

9
48983
by: Randell D. | last post by:
Folks, I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a call to window.open As opposed to closing and re-opening new windows, I would prefer that when the user is finished reading the complete record, they can click a link whereby the main window is sent in to focus.
6
12077
by: Cortes | last post by:
Hi all, I have this parent window poping up the child window. SOmething like this popupWinA= window.open("child.html","popupWinA"," width=300 , height=150) I want this child popupWinA always stay on top of the parent window no matter where the focus is (so that when you click the parent, the child doesn't *disappear* because if its small size).
0
967
by: Csharper95 | last post by:
I'm looking for a way to activate, give focus to the child window in the Multiple Document Interface environment while it is being or rather just before it is being dragged. I have used _DragOver and _DragEnter with a this.Activate code. However the only result I get is that the child window will be dragged, often beneath another window before being activated when the mouse dragging action has ended and athe button is released. Is...
1
3437
by: Samy | last post by:
Hi There, I have a child window opened from aspx page using window.open. On the child window, I have a button(New category) which opens a grandchild. I also have a cancel button on the child window which when clicked should close the child and the granchild windows. Can anybody suggest me how this can be accomplished. I am using image buttons to do this. This is how I am implementing, but for some reason the 'win' is undefined.
4
3572
by: Richard Lewis Haggard | last post by:
What is the mechanism by which a child window can notify its parent that it has been clicked on? -- Richard Lewis Haggard www.Haggard-And-Associates.com
8
2266
by: zacware | last post by:
I have an AJAX enabled page which contains a list of records out of a database which are loaded into a div via an AJAX call. If the user switches to another window, and comes back to this open window later on, I want the list of records to be udpated when the window is back in front a simple onFocus doesn't work, as what happens is that if a button is clicked on the window it causes the onfocus to fire as well
3
2261
by: Natygan | last post by:
Hi, I've got a Web page which can become a parent window : some links use "window.open" to open the desired link into a new child window. This parent window has got an auto-refresh functionality (<meta http-equiv="refresh" content="60">). My point is that when I'm looking at the child window, I don't want the parent window to take the focus when refreshing. Does anybody have an idea ? Thanks !
1
1804
by: varunvashishth | last post by:
hi, I'm facing a problem with displaying a child jsp on top of parent jsp. on clicking a link in parent jsp the child jsp opens up and it has some list of values and other textboxes which gets populated from the cache. child has ok and cancel buttons. my requirement is that as long as child window is active (ie, you havent clicked ok or cancel or closed the window otherwise), user should not be able to do any processing on parent. ...
0
9901
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9751
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10371
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9513
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5743
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4562
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3187
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.