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

Communication between browser windows?



I need guidance on implementing the following functionality in
javascript:

User clicks on a link (or button) in browser window A that brings
up a separate browser popup window B featuring a list/table of 500+
clickable items; clicking on any one of these items causes it (or
rather its label string) to be added to the contents of a textarea
field in the original page A, perhaps after checking that it has
not been added already.

The document in window B must somehow know about the document in
window A, and the script must behave appropriately (i.e. do nothing)
if the document in window A disappears for some reason (e.g. user's
navigation, window closing, etc.) and the user clicks on an item
in window B.

Any advice on implementing this would be much appreciated.

TIA,

jill
--
To s&e^n]d me m~a}i]l r%e*m?o\v[e bit from my a|d)d:r{e:s]s.

Jul 23 '05 #1
2 2753
J Krugman wrote:
I need guidance on implementing the following functionality in
javascript:

User clicks on a link (or button) in browser window A that brings
up a separate browser popup window B featuring a list/table of 500+
clickable items; clicking on any one of these items causes it (or
rather its label string) to be added to the contents of a textarea
field in the original page A, perhaps after checking that it has
not been added already.

The document in window B must somehow know about the document in
window A, and the script must behave appropriately (i.e. do nothing)
if the document in window A disappears for some reason (e.g. user's
navigation, window closing, etc.) and the user clicks on an item
in window B.
if(opener){ //window A is available }}

or better yet, look for a known object in window A.

if(opener.document.forms["formName"].elements["elementName"])

Mick
Any advice on implementing this would be much appreciated.

TIA,

jill

Jul 23 '05 #2
J Krugman wrote:
I need guidance on implementing the following functionality in
javascript:

User clicks on a link (or button) in browser window A that brings
up a separate browser popup window B featuring a list/table of 500+
clickable items; clicking on any one of these items causes it (or
rather its label string) to be added to the contents of a textarea
field in the original page A, perhaps after checking that it has
not been added already.

The document in window B must somehow know about the document in
window A, and the script must behave appropriately (i.e. do nothing)
if the document in window A disappears for some reason (e.g. user's
navigation, window closing, etc.) and the user clicks on an item
in window B.

Any advice on implementing this would be much appreciated.


In the "onclick" event handler of the triggering element in browser
window A call window.open(). You may want to cancel the event by
returning `false' to the handler. In the "onchange" event handler of
the triggering "select" element or (better) in the "onclick" event
handler of the triggering "add" button in window B, read the value
or text of the currently selected item and append it to the "value"
property of the (HTML)TextArea(Element) object in the Window referenced
by the "opener" property of the current Window/global object, possibly
delimited with newline ("\n"). You need to check if "opener" is a valid
object reference and if it has not been closed and if has such an
(HTML)TextArea(Element) object before.

Checking that the value has not been added already is somewhat difficult
as you need to find a way to tell one entry from the other, perhaps
using Regular Expression matching. Probably a (HTML)Select(Element)
object would do better than a (HTML)TextArea(Element) object. How you
add options to a "select" element should be in the FAQ or available via
Google Groups search. You could instead disable the currently selected
option in window B after its value/text has been added to the "textarea"
element in window A but I doubt this can be implemented cross-browser.

Don't forget to provide a server-side alternative for users who have
no client-side script support available.
HTH

PointedEars
Jul 23 '05 #3

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

Similar topics

9
by: Harald Massa | last post by:
Hello, I have a group of Python programms which I want to teach to "talk to each other". All run on Windows, on the same computer or in the same intranet. Security of communication is not an...
7
by: Dan V. | last post by:
Situation: I have to connect with my Windows 2000 server using VS.NET 2003 and C# and connect to a remote Linux server at another company's office and query their XML file. Their file may be...
3
by: Tim Reynolds | last post by:
I support a .Net application running on a SERVER accessing MF Db2 data. Occasionally, we have some type of connection problem that we have been unable to debug up to this point. We typically...
4
by: Vidya Bhagwath | last post by:
Hello Experts, I am porting the C++ code into the Visual C#.NET. My C++ code is mainly based on the serial communication. So I am using the windows structure such as DCB.. etc and the windows...
11
by: Jochen Neyens | last post by:
We're in the process of developing an e-commerce application that vets can use to order medicines. One of the requirements is that the web application can communicate with a locally installed...
21
by: dast | last post by:
Hi, I'm having trouble letting my background thread tell my main thread what to do. I'm trying to tell my main thread to open a form, but when my background thread ends, the form that I...
2
by: ne.seri | last post by:
In short, I'm building a kind of server which is supposed to handle open connections with clients. E.g. client connects to the server, the connection stays open, client sends a request to the...
3
by: =?Utf-8?B?U2VraGFy?= | last post by:
Hi All I have a requirement where the user clicks a button on the windows app. A browser pops up. User enters some data in the browser. And I want the data sent back to the windows app. How do i...
5
by: AeonOfTime | last post by:
Let's assume a web application (in this case a browser-based game) with a custom HTTP server built on PHP, and a client also built on PHP. The client uses the server to access and change data. Even...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.