|
 |
javascript thread: problem with function argument passing
Message #1 by "Kresimir Kondza" <kkondza@h...> on Fri, 8 Jun 2001 21:11:14 +0200
|
|
Ups, i don't know how did those "3D"'s get there, but it wasn't my intention
to put them there. But I still have my problem. Let me tell you a bit more
about it specificli.
I have a dinamyc page. On this page there is a navigation bar and two
sections.
The navbar functions like this. When a user clicks on image1 he should se in
another layer some links. The same is for next two images of navbar.
Now when user clicks on a link from that layer two sections should change
their content.
For this i used changeInnerText function (to change my content) and all of
the content is in couple of arrays.
And in teory it should work just fine, but when i try to pas a variable to
function the debugger tells me that that function is undefined.
Could you tell me what errors should i look for in my script. I'm getting
prety desperate. I't isn't the name, i checked for "" and '' signs. They are
all closed.
Please help
----- Original Message -----
From: <ertoz@c...>
To: "javascript" <javascript@p...>
Sent: Saturday, June 09, 2001 5:26 AM
Subject: [javascript] Re: problem with function argument passing
> i don't know what's up with "3D"'s but if you avoid using keywords (name),
> the code below should work fine. i just removed the 3D's, and
> renamed "name" as "names" and it runs fine. it's trying to alert
> window.name i believe.
>
> > I have a little problem vith functions.
> > let's say i have an Array
> > var name=3Dnew Array(2);
> > name[0]=3D"Mark";
> > name[1]=3D"Carl";
> >
> > Now I want to pass this variable to function AlertName that is activated
>
> > onClick on my page
> > <a href=3D"#" onClick=3D"AlertName(name[0]);">Click me</a>
> >
> > function AlertName(output){
> > alert(output)
> > }
> >
> > While runing my page, when i click on the link i get a debbuger massage
> > saying that 'name' isn't defined
> >
> > Please help me.
|
|
 |