Re: Embedding JavaScript Function Call within String Parameter? (-|-)

  • From: "Marlon Brandão de Sousa" <splyt.lists@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Mon, 5 Nov 2007 09:40:53 -0200

you're talking about the onclick = ".." part?
if so try onclick="UnHideText();"
I think that only one statement can be passed inside these parameters.
If your question is about another different thing then please could
you explain better?
Marlon

2007/11/2, Bryan Garaventa <bgaraventa11@xxxxxxxxxxxxxx>:
> Anyone have any ideas about this? How do you embed a javascript function
> call within a string parameter?
>
> For instance, I first have the link...
>
> <a id="linkElementID" href="#" onclick="UnHideText(); return false;"> Toggle
> show hidden text </a>
>
> Then the functions
> <script>
> function UnHideText() {
> linkElementID.onclick = 'HideText(); return false;';
> // Function to show the text...
> }
> function HideText() {
> linkElementID.onclick = 'UnHideText(); return false;';
> // Function to hide the text again...
> }
> </script>
>
> Each time the link element is clicked, it should reset the onclick to
> trigger the appropriate function. It doesn't appear to work though, the
> embedded function
> call within the string doesn't look to work.
>
> Thanks,
>
> Bryan
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
>


-- 
When you say "I wrote a program that crashed Windows," people just
stare at you blankly and say "Hey, I got those with the system, for
free."
Linus Torvalds
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: