473,326 Members | 2,010 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,326 software developers and data experts.

Urgent!!Global window reference!!

Hi,
In a page, i have many links.
I have some functions in a global file which is included in all
linked pages.
I want to have a reference to a window which is to be opened on
clicking one link and it should be known only to one more link on that
page and not to other links.
I cant have that window reference in that global file, since iam
declaring it initially as Null and modifying its value in that one
particular link. Since all links include this global file they change
the refernce to Null and its value is lost.
What can i do for this?

Plz let me know the earliest..

Jul 23 '05 #1
2 1602
On 30 Aug 2004 01:36:22 -0700, learner wrote:
Urgent!!Global window reference!!
a) Please give your ..
<http://www.physci.org/kbd.jsp?key=1+shift>
...key a rest
Plz let me know the earliest..


b) Please do not come in here screaming
'Urgent' and asking to be told 'the earliest'..
Your question will be asnswered as soon (and if)
someone feels like it.

c) Please note this is not your personal 24Hr
Help desk, it is acctually a discussion forum,
as expounded in the FAQ..

d) You, ..have *checked* the FAQ, haven't you?
<http://www.jibbering.com/faq>

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #2
In article <cg********@odah37.prod.google.com>,
"learner" <v_********@yahoo.com> wrote:
Hi,
In a page, i have many links.
I have some functions in a global file which is included in all
linked pages.
I want to have a reference to a window which is to be opened on
clicking one link and it should be known only to one more link on that
page and not to other links.
Are you using the HTML anchor tag <a> ?

In that case, Evertjan, The Netherlands, answered your question in the
prior post.
I cant have that window reference in that global file, since iam
declaring it initially as Null and modifying its value in that one
particular link. Since all links include this global file they change
the refernce to Null and its value is lost.
The web browser has the responsibility for security and that is a good
thing. The web browser controls the access to variables in a more
absolute manor than you see in c/c++.

How are you getting the window reference? The word link implies you are
using the anchor tag. The words window reference implies that you are
using the window.open function.

Lets say you had files a.html, b.html, and c.html all in the same
directory. Lets say you did this in file a.html:
var myData; // written outside of any function

window.open('b.html',...)
window.open('c.html',...)

Javascript functions in both b.html and c.html would be able to access
variable myData by coding:
opener.myData

You will note that functions in b.html and c.html do not have to declare
opener.myData.

Browser security will require files a.html, b.html, and c.html to all be
in the same directory unless you relax the default security settings.
What can i do for this?


I am not certain what your goal is. Are you trying to employ good
programming practices? Are you trying to encapsulate the data?

A web application can be very big. The nature of the web forces a
decentralized coding style. You will not see the monolithic programs you
find with c/c++ programs. In c/c++, you have to worry more about data
encapsulation. On the web, I think you will find the pieces are smaller.
The web forces you to write decentralized programs. You may feel more
comfortable using global variables in Javascript because there scope is
smaller in the overall picture of your application.

You can use closure to encapsulate your variables if you wish.
See:http://jibbering.com/faq/faq_notes/closures.
I think you need to redesign your application.

Robert
Jul 23 '05 #3

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

Similar topics

2
by: N/A | last post by:
Hey all, If I open a popup like this window.open('http://www.google.com', 'popup', 'width = 618, height = 425, directories = no, location = no, menubar = no, resizable = no, scrollbars = yes,...
3
by: Jonan | last post by:
Hi, I use JavaScript I have tree windows. Jonan1.html has this code erref1=window.open("Jonan2.html", "mypage",null); This opens Jonan2.html and it has this code...
1
by: laxmi | last post by:
Is there a way to test whether a named window is open from a separate window which may not have opened the window? I have tried using: if(windowname == null) win = window.open(...) This...
5
by: Derek Erb | last post by:
I am banging my head against the wall with this one. The following code snippets work perfectly fine in MSIE6. But produce an error in Firefox and do not work at all. BROWSER.HTM <HTML> .......
1
by: Rudy | last post by:
Hi Is there a way is a 'class library' to get the reference to window of application that uses the library ? I'm using class library to create a custom command for a closed source application...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
1
by: yotaxp | last post by:
Alright, I'll try and word this as clearly as possible. Let's say my application (APP) is capable of opening browser windows (WIN1 and WIN2). Once open, the browser windows are capable of freely...
24
by: Jeremy J Starcher | last post by:
While reading c.l.j, I've noticed that some people prefer and indeed even recommend the use of "window.alert()" over "alert()". I can't find any technical reason to make this distinction, and...
5
by: aelred | last post by:
I have a web page where a member can open up a chat window (child window) with another member. - From there the member can also navigate to other web pages. - From other pages in the site, they...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.