[prev in list] [next in list] [prev in thread] [next in thread]
List: velocity-user
Subject: Re: Writing JavaScript with Velocity
From: Matt Raible <matt () raibledesigns ! com>
Date: 2003-10-29 2:24:26
[Download RAW message or body]
I got it working by using ${node}.setBehavior)('classic');
Thanks for the help!
Matt
On Oct 28, 2003, at 7:10 PM, Jeff Linwood wrote:
> Hi,
>
> I take it Velocity is trying to evaluate .setBehavior, which is a
> JavaScript method?
>
> Can you try string concatenation inside Velocity?
>
> It would look something like this:
>
> #set($setClassic = ".setBehavior('classic')")
> #set($treejs = "$node$setClassic")
> $treejs
>
>
> Hope this helps,
> Jeff Linwood
>
>
> Matt Raible wrote:
>
>> I have the following VTL that I'm using to write JavaScript:
>> #if ($level == 0)
>> #set ($node = $menu.name)
>> var $node = new WebFXTree('$menu.title');
>> $node.setBehavior('classic');
>> #end
>> It's puking at $node.setBehavior. Ideally, this would print out
>> something
>> like the following:
>> var tree = new WebFXTree('Root');
>> tree.setBehavior('classic');
>> Is this possible, or do I have to use JavaScript's eval function?
>> Thanks,
>> Matt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic