473,545 Members | 666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shared Variable

Hi all,

i have a problem with javascript variable.
I have a script that sets a global variable and open a dialog, then
when i
push a button of this dialog and i read the variable, this variable
isn't set to last value but is not defined.

How can i do for have equal reference for this variable.?

Thanks

Stefano

I use Mozilla 1.4
Jul 20 '05 #1
3 3008
Hello,

How are you accessing this variable?

Perhaps you're not accessing the variable correctly...For example to access
a variable in the opener from the opened window, you would:
opener.window.t heVar = 'new Value';

--
Elias
"Stefano" <st******@liber o.it> wrote in message
news:82******** *************** ***@posting.goo gle.com...
Hi all,

i have a problem with javascript variable.
I have a script that sets a global variable and open a dialog, then
when i
push a button of this dialog and i read the variable, this variable
isn't set to last value but is not defined.

How can i do for have equal reference for this variable.?

Thanks

Stefano

I use Mozilla 1.4

Jul 20 '05 #2
Stefano wrote:
Hi all,

i have a problem with javascript variable.
I have a script that sets a global variable and open a dialog, then
when i
push a button of this dialog and i read the variable, this variable
isn't set to last value but is not defined.

How can i do for have equal reference for this variable.?

Thanks

Stefano

I use Mozilla 1.4


Send the script.
You make a mistake somewhere in your script probably, but how can we tell if
we don't see it?

Regards,
Erwin Moller
Jul 20 '05 #3
Erwin Moller <si************ *************** *************** @spamyourself.c om> wrote in message news:<40******* **************@ news.xs4all.nl> ...
Stefano wrote:
Hi all,

i have a problem with javascript variable.
I have a script that sets a global variable and open a dialog, then
when i
push a button of this dialog and i read the variable, this variable
isn't set to last value but is not defined.

How can i do for have equal reference for this variable.?

Thanks

Stefano

I use Mozilla 1.4


Send the script.
You make a mistake somewhere in your script probably, but how can we tell if
we don't see it?

Hi.
ok, this is my Javascript code:

var active_el
var ed;
.......
open_ed();

function open_ed()
{
ed=window.openD ialog("chrome://isawiki/content/myedit.html","E ditor","depende nt");
ed.innerWidth=2 00;
ed.innerHeight= 230;
ed.moveTo(500,3 90);
}
......
......
temp.addEventLi stener('click', set_active_elem ent,true);
function set_active_elem ent(e)
{
active_element( e);
}
function active_element( e)
{
//alert(e.target. nodeName);
active_el=e.tar get; //HERE I SET VARIABLE
if (active_el.chil dNodes.length== 1)
{
var vett=active_el. childNodes;
if ((vett[0].nodeName.toUpp erCase()=="P")& &(!vett[0].innerHTML))
{active_el=acti ve_el.firstChil d;}//HERE I SET VARIABLE
}
.......

THEN WHEN I CLICK A BUTTON OVER A DIALOG, DIALOG EXECUTES THIS:

function update()
{
alert('hai scelto '+choice);
//ACTIVE_EL is always null
if (active_el==nul l)

{
select_ok=false ;
alert('nullo');
}
.......

Thanks, Stefano
Jul 20 '05 #4

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

Similar topics

3
314
by: tom | last post by:
Hello, I'm using the ms data access application blocks. My question is about the fact that everywhere shared methods are used. Does this mean that when more than 1 user at the same time executes the same function they can interfere with one another as these functions are the same for all instances of the class (and thus internal...
10
3534
by: John Brock | last post by:
I have a base class with several derived classes (I'm writing in VB.NET). I want each derived class to have a unique class ID (a String), and I want the derived classes to inherit from the base class *Shared* methods which make use of the class ID. So I gave the base class a classID field, and then I gave the derived classes Shared...
1
4845
by: Qingdong Z. | last post by:
Posted in asp.net newsgroup, no answer. Hope some experts can help me here 1. Does class shared variable share same feathers as ASP.NET application variable? 2. If it is, it may work better than application variables, because we don't need type conversion 3. Can web farm share same class shared variable? This is not critical for my case,...
4
11715
by: John Kraft | last post by:
Hi all, My question is more of a phylisophical one here, but I am wondering what the difference is (effectively and performance wise) between using a shared variable/static variable and using a session variable. I have two different applications right now that effectively perform the same action at one point. In the one application I...
3
1803
by: Joe Fallon | last post by:
I have a Shared varibale in a base class and all the Shared methods in the sub-classes use it (and CHANGE it). I thought I was saving myself the "trouble" of Dimming this variable inside each Shared method. But now I wonder if I will have a problem in a multi-user environment with code that changes this variable. Can someone please review...
10
3663
by: darrel | last post by:
I'm still trying to sort out in my head the differences between public and shared when referring to declaring properties or variables. This is my understanding: shared - akin to a 'global' variable for the application. Any other code within the application can access it. public - can be shared across the application if instatiated. Does...
15
4905
by: Rob Nicholson | last post by:
A consequence of the ASP.NET architecture on IIS has just hit home with a big thud. It's to do with shared variables. Consider a module like this: Public Module Functions Public GlobalName As String ' this is ineffect a global application object End Module
8
1263
by: gemel | last post by:
I have been reading sime material in .NET that throws some doubt on my understanding of shared procedures. With regard to object programming I assumed that variables declared within a class were private to the class, each object would have access to it's ver own copy of that variable. With regard to the methods defined for a class, I...
4
4894
by: Boni | last post by:
Dear all, how can I initialize shared variable? i.e class A private shared B as boolean end class in C++ I would write in the global scope A::B=true What is the proper way in vb
11
3144
by: eBob.com | last post by:
I have this nasty problem with Shared methods and what I think of as "global storage" - i.e. storage declared outside of any subroutines or functions. In the simple example below this "global" storage is ButtonHasBeenClicked. In this simple example code in Form1 calls a routine in Module1 which then calls code back in Form1 (subroutine...
0
7467
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...
0
7401
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...
0
7807
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...
1
7419
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...
0
5971
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...
1
5326
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...
0
3450
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...
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
703
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...

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.