You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Int64 <vi...@gmail.com> on 2009/06/10 08:05:12 UTC

Velocity Variables are accepted in JavaScript Array??

I am developing an Ajax AutoComplete using javascript.

I have an Array in which i am adding elements.

	var suggestions = new Array();

#foreach($show in $allShowList)

suggestions.push($show);

#end

when i do the above it does not add the variables to the list(it doesnt
display then in autosuggest)

but if i do
$show="someValue"
suggestions.push($show);

Then it adds this thing

Can some1 tell me why, is it a type compatibility issue?
-- 
View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23956244.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


RE: Velocity Variables are accepted in JavaScript Array??

Posted by Matt Brown <Ma...@citrixOnline.com>.
Well when you say "auto suggest", I have no idea what IDE you are using or what it does or does not support.

The key question is, does the suggestions.push(element); show up in the rendered page when you view the source? 

-----Original Message-----
From: Int64 [mailto:vineetbindal@gmail.com] 
Sent: Wednesday, June 10, 2009 10:37 AM
To: user@velocity.apache.org
Subject: RE: Velocity Variables are accepted in JavaScript Array??


Hi I am sure that the list is not empty,

Becouse at the same time i am displaying the values from the list in a table to make sure that its not empty, that what i am confused about . allthough its displaying the values if i hardcode them and list is displaying values in the table. why suggestions.push(...) isnt accepting and displaing them in auto suggest???

Matt Brown-20 wrote:
> 
> Are you sure that $allShowList is a non-empty list?
> 
> Let's say the list has five items - then your foreach loop is 
> effectively generating the following javascript:
> 
> suggestions.push(...);
> suggestions.push(...);
> suggestions.push(...);
> suggestions.push(...);
> suggestions.push(...);
> 
> Where "..." is the elements of the list.
> 
> The fact that it works in your latter case (when you explicitly give a 
> value to the variable) and not in the former (which because it is a 
> foreach loop, relies on $allShowList to NOT be empty) suggests that 
> you have issues with the list itself.
> 
> What does the rendered HTML/Javascript show?
> 
> I think you might be confused on what Velocity does (generates the 
> HTML or whatever other files, at request-time) and where Javascript 
> comes into play (once a user's browser 'runs' the page).
> 
> -----Original Message-----
> From: Int64 [mailto:vineetbindal@gmail.com]
> Sent: Wednesday, June 10, 2009 2:05 AM
> To: user@velocity.apache.org
> Subject: Velocity Variables are accepted in JavaScript Array??
> 
> 
> I am developing an Ajax AutoComplete using javascript.
> 
> I have an Array in which i am adding elements.
> 
> 	var suggestions = new Array();
> 
> #foreach($show in $allShowList)
> 
> suggestions.push($show);
> 
> #end
> 
> when i do the above it does not add the variables to the list(it 
> doesnt display then in autosuggest)
> 
> but if i do
> $show="someValue"
> suggestions.push($show);
> 
> Then it adds this thing
> 
> Can some1 tell me why, is it a type compatibility issue?
> --
> View this message in context:
> http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Ar
> ray---tp23956244p23956244.html Sent from the Velocity - User mailing 
> list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> 

--
View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23963673.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


RE: Velocity Variables are accepted in JavaScript Array??

Posted by Int64 <vi...@gmail.com>.
Hi I am sure that the list is not empty,

Becouse at the same time i am displaying the values from the list in a table
to make sure that its not empty, that what i am confused about . allthough
its displaying the values if i hardcode them and list is displaying values
in the table. why suggestions.push(...) isnt accepting and displaing them in
auto suggest???

Matt Brown-20 wrote:
> 
> Are you sure that $allShowList is a non-empty list?
> 
> Let's say the list has five items - then your foreach loop is effectively
> generating the following javascript:
> 
> suggestions.push(...);
> suggestions.push(...);
> suggestions.push(...);
> suggestions.push(...);
> suggestions.push(...);
> 
> Where "..." is the elements of the list.
> 
> The fact that it works in your latter case (when you explicitly give a
> value to the variable) and not in the former (which because it is a
> foreach loop, relies on $allShowList to NOT be empty) suggests that you
> have issues with the list itself.
> 
> What does the rendered HTML/Javascript show?
> 
> I think you might be confused on what Velocity does (generates the HTML or
> whatever other files, at request-time) and where Javascript comes into
> play (once a user's browser 'runs' the page).
> 
> -----Original Message-----
> From: Int64 [mailto:vineetbindal@gmail.com] 
> Sent: Wednesday, June 10, 2009 2:05 AM
> To: user@velocity.apache.org
> Subject: Velocity Variables are accepted in JavaScript Array??
> 
> 
> I am developing an Ajax AutoComplete using javascript.
> 
> I have an Array in which i am adding elements.
> 
> 	var suggestions = new Array();
> 
> #foreach($show in $allShowList)
> 
> suggestions.push($show);
> 
> #end
> 
> when i do the above it does not add the variables to the list(it doesnt
> display then in autosuggest)
> 
> but if i do
> $show="someValue"
> suggestions.push($show);
> 
> Then it adds this thing
> 
> Can some1 tell me why, is it a type compatibility issue?
> --
> View this message in context:
> http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23956244.html
> Sent from the Velocity - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23963673.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


RE: Velocity Variables are accepted in JavaScript Array??

Posted by Matt Brown <Ma...@citrixOnline.com>.
Are you sure that $allShowList is a non-empty list?

Let's say the list has five items - then your foreach loop is effectively generating the following javascript:

suggestions.push(...);
suggestions.push(...);
suggestions.push(...);
suggestions.push(...);
suggestions.push(...);

Where "..." is the elements of the list.

The fact that it works in your latter case (when you explicitly give a value to the variable) and not in the former (which because it is a foreach loop, relies on $allShowList to NOT be empty) suggests that you have issues with the list itself.

What does the rendered HTML/Javascript show?

I think you might be confused on what Velocity does (generates the HTML or whatever other files, at request-time) and where Javascript comes into play (once a user's browser 'runs' the page).

-----Original Message-----
From: Int64 [mailto:vineetbindal@gmail.com] 
Sent: Wednesday, June 10, 2009 2:05 AM
To: user@velocity.apache.org
Subject: Velocity Variables are accepted in JavaScript Array??


I am developing an Ajax AutoComplete using javascript.

I have an Array in which i am adding elements.

	var suggestions = new Array();

#foreach($show in $allShowList)

suggestions.push($show);

#end

when i do the above it does not add the variables to the list(it doesnt display then in autosuggest)

but if i do
$show="someValue"
suggestions.push($show);

Then it adds this thing

Can some1 tell me why, is it a type compatibility issue?
--
View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23956244.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: Velocity Variables are accepted in JavaScript Array??

Posted by Int64 <vi...@gmail.com>.
Yes you are right!!

bluejoe-2 wrote:
> 
> maybe the line $foo=bar is parsed as a legal JavaScript assignment
> statement
> according to Florin Vancea's suggestion
> if you have a look at the source codes in web browser
> you may get the answer
> 
> ----- Original Message ----- 
> From: "Int64" <vi...@gmail.com>
> To: <us...@velocity.apache.org>
> Sent: Friday, June 12, 2009 10:50 AM
> Subject: Re: Velocity Variables are accepted in JavaScript Array??
> 
> 
>> 
>> #set($foo = "bar")
>> suggest.push("$foo")
>> suggest.push($foo)//Actually this also works.. if i do it like this
>> $foo="bar"//instead of #set($foo = "bar")
>> 
>> but if $foo=(some value coming from database such as)//$foo=$value//then
>> it
>> does not work.
>> 
>> i donno why it was behaving like this
>> 
>> Byron Foster-2 wrote:
>>> 
>>> Looking at the generated javascript should reveal all. If in Velocity  
>>> you say
>>> 
>>> #set($foo = "bar")
>>> suggest.push("$foo")
>>> suggest.push($foo)
>>> 
>>> will render as:
>>> 
>>> suggest.push("bar")
>>> suggest.push(bar)
>>> 
>>> When the javascript runs the second line is referencing a variable  
>>> 'bar' which is not defined, and will cause a javascript error.
>>> 
>>> If you have the error console running in your browser, you should see  
>>> javascript errors to this effect.
>>> 
>>> On Jun 11, 2009, at 6:24 , Int64 wrote:
>>> 
>>>> Your suggestion for suggestions.push("$show"); really worked,
>>>>
>>>> But can you please explain why suggestions.push($show);was not  
>>>> working and
>>>> it was not working with my values from database(it was working for
>>>> hard-coded values). and why your suggestion worked??
>>>>
>>>> bluejoe-2 wrote:
>>>>>
>>>>> if $show is a string, you can try
>>>>> suggestions.push("$show");
>>>>>
>>>>> VTL renders on server-side
>>>>> while javascript executes on browser
>>>>>
>>>>> yours,
>>>>> bluejoe
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>>> For additional commands, e-mail: user-help@velocity.apache.org
>>> 
>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23992058.html
>> Sent from the Velocity - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>> 
>> 
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4101 (20090525) __________
>> 
>> The message was checked by ESET NOD32 Antivirus.
>> 
>> http://www.eset.com
>> 
>> 
>>
> 

-- 
View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23992253.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: Velocity Variables are accepted in JavaScript Array??

Posted by bluejoe <bl...@gmail.com>.
maybe the line $foo=bar is parsed as a legal JavaScript assignment statement
according to Florin Vancea's suggestion
if you have a look at the source codes in web browser
you may get the answer

----- Original Message ----- 
From: "Int64" <vi...@gmail.com>
To: <us...@velocity.apache.org>
Sent: Friday, June 12, 2009 10:50 AM
Subject: Re: Velocity Variables are accepted in JavaScript Array??


> 
> #set($foo = "bar")
> suggest.push("$foo")
> suggest.push($foo)//Actually this also works.. if i do it like this
> $foo="bar"//instead of #set($foo = "bar")
> 
> but if $foo=(some value coming from database such as)//$foo=$value//then it
> does not work.
> 
> i donno why it was behaving like this
> 
> Byron Foster-2 wrote:
>> 
>> Looking at the generated javascript should reveal all. If in Velocity  
>> you say
>> 
>> #set($foo = "bar")
>> suggest.push("$foo")
>> suggest.push($foo)
>> 
>> will render as:
>> 
>> suggest.push("bar")
>> suggest.push(bar)
>> 
>> When the javascript runs the second line is referencing a variable  
>> 'bar' which is not defined, and will cause a javascript error.
>> 
>> If you have the error console running in your browser, you should see  
>> javascript errors to this effect.
>> 
>> On Jun 11, 2009, at 6:24 , Int64 wrote:
>> 
>>> Your suggestion for suggestions.push("$show"); really worked,
>>>
>>> But can you please explain why suggestions.push($show);was not  
>>> working and
>>> it was not working with my values from database(it was working for
>>> hard-coded values). and why your suggestion worked??
>>>
>>> bluejoe-2 wrote:
>>>>
>>>> if $show is a string, you can try
>>>> suggestions.push("$show");
>>>>
>>>> VTL renders on server-side
>>>> while javascript executes on browser
>>>>
>>>> yours,
>>>> bluejoe
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23992058.html
> Sent from the Velocity - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4101 (20090525) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
> 
> 
>

Re: Velocity Variables are accepted in JavaScript Array??

Posted by Int64 <vi...@gmail.com>.
#set($foo = "bar")
suggest.push("$foo")
suggest.push($foo)//Actually this also works.. if i do it like this
$foo="bar"//instead of #set($foo = "bar")

but if $foo=(some value coming from database such as)//$foo=$value//then it
does not work.

i donno why it was behaving like this

Byron Foster-2 wrote:
> 
> Looking at the generated javascript should reveal all. If in Velocity  
> you say
> 
> #set($foo = "bar")
> suggest.push("$foo")
> suggest.push($foo)
> 
> will render as:
> 
> suggest.push("bar")
> suggest.push(bar)
> 
> When the javascript runs the second line is referencing a variable  
> 'bar' which is not defined, and will cause a javascript error.
> 
> If you have the error console running in your browser, you should see  
> javascript errors to this effect.
> 
> On Jun 11, 2009, at 6:24 , Int64 wrote:
> 
>> Your suggestion for suggestions.push("$show"); really worked,
>>
>> But can you please explain why suggestions.push($show);was not  
>> working and
>> it was not working with my values from database(it was working for
>> hard-coded values). and why your suggestion worked??
>>
>> bluejoe-2 wrote:
>>>
>>> if $show is a string, you can try
>>> suggestions.push("$show");
>>>
>>> VTL renders on server-side
>>> while javascript executes on browser
>>>
>>> yours,
>>> bluejoe
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23992058.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: Velocity Variables are accepted in JavaScript Array??

Posted by Byron Foster <by...@base2.cc>.
Looking at the generated javascript should reveal all. If in Velocity  
you say

#set($foo = "bar")
suggest.push("$foo")
suggest.push($foo)

will render as:

suggest.push("bar")
suggest.push(bar)

When the javascript runs the second line is referencing a variable  
'bar' which is not defined, and will cause a javascript error.

If you have the error console running in your browser, you should see  
javascript errors to this effect.

On Jun 11, 2009, at 6:24 , Int64 wrote:

> Your suggestion for suggestions.push("$show"); really worked,
>
> But can you please explain why suggestions.push($show);was not  
> working and
> it was not working with my values from database(it was working for
> hard-coded values). and why your suggestion worked??
>
> bluejoe-2 wrote:
>>
>> if $show is a string, you can try
>> suggestions.push("$show");
>>
>> VTL renders on server-side
>> while javascript executes on browser
>>
>> yours,
>> bluejoe


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: Velocity Variables are accepted in JavaScript Array??

Posted by Florin Vancea <fv...@maxiq.ro>.
When you said

$show="someValue"

you was "talking" JavaScript, setting a variable named $show to be a string.

Take a look at the source that reaches the browser in each case and you'll
understand.

Velocity generates the page that gets sent to the browser. The browser
receives it and if it's legal JavaScript code, it executes it. That is what
bluejoe-2 was saying.

----- Original Message ----- 
From: "Int64" <vi...@gmail.com>
To: <us...@velocity.apache.org>
Sent: Thursday, June 11, 2009 4:24 PM
Subject: Re: Velocity Variables are accepted in JavaScript Array??


>
> Your suggestion for suggestions.push("$show"); really worked,
>
> But can you please explain why suggestions.push($show);was not working and
> it was not working with my values from database(it was working for
> hard-coded values). and why your suggestion worked??
>
> bluejoe-2 wrote:
> >
> > if $show is a string, you can try
> > suggestions.push("$show");
> >
> > VTL renders on server-side
> > while javascript executes on browser
> >
> > yours,
> > bluejoe
> >
> > ----- Original Message ----- 
> > From: "Int64" <vi...@gmail.com>
> > To: <us...@velocity.apache.org>
> > Sent: Wednesday, June 10, 2009 2:05 PM
> > Subject: Velocity Variables are accepted in JavaScript Array??
> >
> >
> >>
> >> I am developing an Ajax AutoComplete using javascript.
> >>
> >> I have an Array in which i am adding elements.
> >>
> >> var suggestions = new Array();
> >>
> >> #foreach($show in $allShowList)
> >>
> >> suggestions.push($show);
> >>
> >> #end
> >>
> >> when i do the above it does not add the variables to the list(it doesnt
> >> display then in autosuggest)
> >>
> >> but if i do
> >> $show="someValue"
> >> suggestions.push($show);
> >>
> >> Then it adds this thing
> >>
> >> Can some1 tell me why, is it a type compatibility issue?
> >> -- 
> >> View this message in context:
> >>
http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23956244.html
> >> Sent from the Velocity - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> >> For additional commands, e-mail: user-help@velocity.apache.org
> >>
> >>
> >> __________ Information from ESET NOD32 Antivirus, version of virus
> >> signature database 4101 (20090525) __________
> >>
> >> The message was checked by ESET NOD32 Antivirus.
> >>
> >> http://www.eset.com
> >>
> >>
> >>
> >
>
> -- 
> View this message in context:
http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23981251.html
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: Velocity Variables are accepted in JavaScript Array??

Posted by Int64 <vi...@gmail.com>.
Your suggestion for suggestions.push("$show"); really worked,

But can you please explain why suggestions.push($show);was not working and
it was not working with my values from database(it was working for
hard-coded values). and why your suggestion worked??

bluejoe-2 wrote:
> 
> if $show is a string, you can try 
> suggestions.push("$show");
> 
> VTL renders on server-side
> while javascript executes on browser
> 
> yours,
> bluejoe
>  
> ----- Original Message ----- 
> From: "Int64" <vi...@gmail.com>
> To: <us...@velocity.apache.org>
> Sent: Wednesday, June 10, 2009 2:05 PM
> Subject: Velocity Variables are accepted in JavaScript Array??
> 
> 
>> 
>> I am developing an Ajax AutoComplete using javascript.
>> 
>> I have an Array in which i am adding elements.
>> 
>> var suggestions = new Array();
>> 
>> #foreach($show in $allShowList)
>> 
>> suggestions.push($show);
>> 
>> #end
>> 
>> when i do the above it does not add the variables to the list(it doesnt
>> display then in autosuggest)
>> 
>> but if i do
>> $show="someValue"
>> suggestions.push($show);
>> 
>> Then it adds this thing
>> 
>> Can some1 tell me why, is it a type compatibility issue?
>> -- 
>> View this message in context:
>> http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23956244.html
>> Sent from the Velocity - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>> 
>> 
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4101 (20090525) __________
>> 
>> The message was checked by ESET NOD32 Antivirus.
>> 
>> http://www.eset.com
>> 
>> 
>>
> 

-- 
View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23981251.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Re: Velocity Variables are accepted in JavaScript Array??

Posted by bluejoe <bl...@gmail.com>.
if $show is a string, you can try 
suggestions.push("$show");

VTL renders on server-side
while javascript executes on browser

yours,
bluejoe
 
----- Original Message ----- 
From: "Int64" <vi...@gmail.com>
To: <us...@velocity.apache.org>
Sent: Wednesday, June 10, 2009 2:05 PM
Subject: Velocity Variables are accepted in JavaScript Array??


> 
> I am developing an Ajax AutoComplete using javascript.
> 
> I have an Array in which i am adding elements.
> 
> var suggestions = new Array();
> 
> #foreach($show in $allShowList)
> 
> suggestions.push($show);
> 
> #end
> 
> when i do the above it does not add the variables to the list(it doesnt
> display then in autosuggest)
> 
> but if i do
> $show="someValue"
> suggestions.push($show);
> 
> Then it adds this thing
> 
> Can some1 tell me why, is it a type compatibility issue?
> -- 
> View this message in context: http://www.nabble.com/Velocity-Variables-are-accepted-in-JavaScript-Array---tp23956244p23956244.html
> Sent from the Velocity - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4101 (20090525) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
> 
> 
>