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