473,651 Members | 2,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

windows object identity

Is there a way to tell one window from another? A quick look into wndow
object properties revealed nothing obvious. I want to keep track of
window object identity in a hidden input widget, so that whenever user
clones the window, I'll be able identify this and provide an extra
session.

Apr 22 '06 #1
26 5097
mi************* ****@yahoo.com wrote:
Is there a way to tell one window from another?


Sure. If window1 == window2 yields `false', the Window objects referred to
are different, otherwise both references point to the same Window object.
PointedEars
Apr 22 '06 #2

Thomas 'PointedEars' Lahn wrote:
mi************* ****@yahoo.com wrote:
Is there a way to tell one window from another?


Sure. If window1 == window2 yields `false', the Window objects referred to
are different, otherwise both references point to the same Window object.


Yes, but the scope is outside of Java Script environment. I want to
save window.id or its equivalent as a text string in a hidden form
widget that can be passed as parameter to servlet/JSP processor. Within
the javascript on page, I prefer not to have any knowledge about the
other browser windows.

Apr 22 '06 #3
Thomas 'PointedEars' Lahn said the following on 4/21/2006 10:51 PM:
mi************* ****@yahoo.com wrote:
Is there a way to tell one window from another?


Sure. If window1 == window2 yields `false', the Window objects referred to
are different, otherwise both references point to the same Window object.


You really should learn to read, and comprehend, English before replying
to a lot of the posts you reply to. Had you continued reading, and
comprehended, the context you would have been able to give a better -
more informed - response.

The answer to the question is no. And you are, yet again, showing your
immature pedantic behavior.

Now, go ahead, use your ad hominem defense.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 22 '06 #4
ASM
mi************* ****@yahoo.com a écrit :
Yes, but the scope is outside of Java Script environment. I want to
save window.id or its equivalent as a text string in a hidden form
widget that can be passed as parameter to servlet/JSP processor. Within
the javascript on page, I prefer not to have any knowledge about the
other browser windows.


windows names are only known by the file loaded (or at best by the window)

I think that to refer to a (precedent) window.name in a new file loaded
would'nt be abble to work.

Anyway I don't understand why you need to know in witch windows files
are displayed.
Isn't problem of the browser or its user ?

--
Stephane Moriaux et son [moins] vieux Mac
Apr 22 '06 #5
On 2006-04-22 05:12:31 +0200, mi************* ****@yahoo.com said:

Thomas 'PointedEars' Lahn wrote:
mi************* ****@yahoo.com wrote:
Is there a way to tell one window from another?


Sure. If window1 == window2 yields `false', the Window objects referred to
are different, otherwise both references point to the same Window object.


Yes, but the scope is outside of Java Script environment. I want to
save window.id or its equivalent as a text string in a hidden form
widget that can be passed as parameter to servlet/JSP processor. Within
the javascript on page, I prefer not to have any knowledge about the
other browser windows.


I don't really understand what you intend to do with those IDs.

First, if you want all windows with your site loaded into them to
communicate with each other directly :

Are your extra windows opened by JavaScript (window.open) or do you
want to track any window opened ?

For exemple, if the user manually opens two tabs (or windows) in his
browser and connects to your website on both, a script in one tab will
*never* be able to access the other directly. They could communicate
via the server, or by sharing cookies.

If you care only about window.open'ed windows, then the opener has a
reference to the popup (the value returned by window.open()) and the
popup can use window.opener to access it's opener.

But that has nothing to do with IDs.

Either way you could give a unique ID to each window (that's the
session ID you're already using anyway, so no problem here, just assign
an "id" property to the window if you want to formalize that), but of
course this id cannot be found by getElementById( ).

If the windows can access each other, then they can read each other's
id property (I still can't begin to guess why you'd want them to do
that). If not, too bad.
--
David Junger

Apr 22 '06 #6
Touffy wrote:
Are your extra windows opened by JavaScript (window.open) or do you
want to track any window opened ?
Cloning new browser window is as simple as "Ctrl-New Window". The end
user may continue his session from a new window as well as the old one.
For exemple, if the user manually opens two tabs (or windows) in his
browser and connects to your website on both, a script in one tab will
*never* be able to access the other directly. They could communicate
via the server, or by sharing cookies.
I dont want one window to be aware of the other one.. All I want from
the script is to tell some surrogate value of the window identity. This
could be just raw address.

I'm kind of perplexed. Any OO programming language can output the
reference/pointer to the object. Not in JS?
Either way you could give a unique ID to each window (that's the
session ID you're already using anyway, so no problem here, just assign
an "id" property to the window if you want to formalize that), but of
course this id cannot be found by getElementById( ).


Therefore, you refer me to the session variable in JSP (which BTW I
don't use)? How does JSP/Servlet session behaves when I clone the
window? (If they are different then it solves my problem)

Apr 24 '06 #7
mi************* ****@yahoo.com wrote:
How does JSP/Servlet session behaves when I clone the
window? (If they are different then it solves my problem)


Just tested: The session object for the cloned browser window is the
same:-(

Apr 24 '06 #8
mi************* ****@yahoo.com wrote:
Touffy wrote:
For exemple, if the user manually opens two tabs (or windows) in his
browser and connects to your website on both, a script in one tab will
*never* be able to access the other directly. They could communicate
via the server, or by sharing cookies.
I dont want one window to be aware of the other one.. All I want from
the script is to tell some surrogate value of the window identity. This
could be just raw address.


Each window must have a different name, so you could use the `name' property
of Window objects.
I'm kind of perplexed. Any OO programming language can output the
reference/pointer to the object. Not in JS?


I have already said that you can compare Window object references against
each other, have I not?

But if the user opens the window, there is no reference/pointer to an object
in JS, unless you access the Windows (or whatever) API. Browser windows
are _not_ part of the programming language (they have been, but that was
in the JS-on-NN/IE-only times) but of the Application Object Model the
browser provides. It is your fault not recognizing that, not JS's.
PointedEars
--
Alcohol and Math don't mix. So please don't drink and derive!
Apr 24 '06 #9
Thomas 'PointedEars' Lahn wrote:
Each window must have a different name, so you could use the `name' property
of Window objects.
How? The script

<script>
alert(window.na me)
</script>

outputs blank value

If I clone the window, the output doest change.
But if the user opens the window, there is no reference/pointer to an object
in JS, unless you access the Windows (or whatever) API.


OK, failing that, is there other programmtic method to distinguish
between browser windows?

Apr 24 '06 #10

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

Similar topics

0
1296
by: Armin Zingler | last post by:
Hello, to reproduce the follwoing steps, "managed DirectX" must be installed. Despite, this is not a DirectX but an IDE problem (at least in VB.Net). As nobody answered in m.p.vsnet.ide and m.p.vsnet.debugging, I try it here. 1. Create a new WindowsApplication 2. Add references to - Microsoft.DirectX.dll - Microsoft.DirectX.Direct3D.dll
1
2788
by: Marlon | last post by:
<! -- Web.config--> <authentication mode="Windows" /> <identity impersonate="true" /> <! -- Web.config--> where Configurations.ADsUsersPath is LDAP://domain.com/ou=Users,ou=Corporate,dc=domain,dc=com ds = New DirectoryEntry(Configurations.ADsUsersPath)
6
2164
by: Nathan Kovac | last post by:
Yesterday afternoon I was getting the following errors in a windows service: 'DatabaseManager.DataComponent', 'Error', '3 Errors: Line: 0 - Metadata file 'ScriptingMethods.dll' could not be found Line: 0 - Metadata file 'RemoteLoader.dll' could not be found Line: 0 - Metadata file 'wwScripting.dll' could not be found' Service ran all night fine. This morning I reconnected to the process and the errors are no longer there. Only thing...
4
2412
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). The problem is that the user who "owns" the service is always the ASPNET account. That's not good since you don't see the actual application (because it's owned by ASPNET). I've tried changed the processmodel section in the machine.config file to...
5
2686
by: pberna | last post by:
Dear all, I built a Web Form application to start and stop a Windows Service remotely. I successful tested the application on Windows 2000 server + IIS. I must include the ASPNET user to the Administration group (on server side) to have the necessary authorization to start a Windows Service (I don't understand why "Power User" rights are not enough to do the same thing) Although I'm able to start a service using windows 2000 server...
10
2893
by: newbie | last post by:
My application_end event in global.asax is not working as-is. In order to debug, I want to call it from another file, say debug.aspx through a button, e.g. "end application". How do I call application_end in global.asax from debug.aspx? thanks
11
1826
by: Eric | last post by:
Hello, I have a web app that uploads files to a file server (different box than the web server). The application uses NT integrated authentication, but no users should have permissions to the file server. How can I use a fixed domain account to upload the files to the file server while still preserving the users' Windows integrated authentication on the web server?
17
5083
by: Jon B | last post by:
Hi All! I have a ASP.NET 2.0 site that works on the Windows 2000 Server. However, when I tried to view this site on my local Windows XP machine, I get "Server Unavailable". If I switch the Windows XP IIS back to ASP.NET 1.1 then I get the Configuration Error (which is understandable because I'm trying to run an ASP.NET 2 site with 1.1 framework). I can however view other ASP.NET 1.1 sites on my local Windows XP machine. It's only the...
4
5804
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this article: http://support.microsoft.com/?id=306158#4 This doesn't work in Windows 2008 Server, we receive the following exception:
0
8349
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
8275
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
8695
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
8460
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,...
0
8576
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
7296
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...
0
4143
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...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
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

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.