473,789 Members | 2,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2781
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.docum ent.forms["formName"].elements["elementNam e"])

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(El ement)
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
2625
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 issue (encryption on lower level protocols / intra computer communication). Partially these programs are using wxPython.
7
2690
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 updated every hour or so. How can I do this easily? I would like to use secure communication even encryption if possible. I would query and insert locally only the newest records found in that XML file to an xml or MS access db.
3
43229
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 receive one of these IBM.Data.DB2.DB2Exception messages: ERROR SQL30081N A communication error has been detected. Communication protocol being used: ‘TCP/IP'. Communication API being used: ‘SOCKETS'. Location where the error was detected:...
4
4739
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 functions frequently in my C++ code. I came to know how to import the windows functions into Visual C#.NET. But what is the method to import windows structure into Visual C#.NET? It will be very helpful for me if anybody can give me the WebID that...
11
2004
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 practice management application that uses MS-Access as a backend database. This way shipped e-commerce orders can we imported in the practice management application to update the stock levels of medicines. The web-application will be written in...
21
1945
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 thought my main thread had opened disappears. Obviously there's something that I don't understand here. The background thread is run in another class on another form. How do I,
2
2466
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 server, server reasoned, and so on... The thing is that connection MUST always stay open. I'm using C++, and as for sockets, I'm using native syscalls, not MFC. I'm using stream sockets for communication. Another thing is that is should work both...
3
1290
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 do this. I see two issues here. How would the client know when I am done with my Changes on the browser. We thought we would some polling which is a bad idea. Any suggestions???
5
3177
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 if the client server communication is not directly visible to the user (who logs into the client), the fact that the server is publicly accessible (a port sniffer would be enough to find it) means the communication has to be secured. How...
0
9663
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
9511
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
10195
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7525
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
5415
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
4090
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
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
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.