He said param1 and param2 are determined on the client side -- which means 
they cannot be set on the server side by web2py. Of course, I don't know 
what he's actually doing on the client side, so this exact code may or may 
not be relevant. Do you have an alternative suggestion?

Anthony

On Sunday, May 20, 2012 7:57:10 PM UTC-4, Bruce Wade wrote:
>
> Why would you do the code like that?? 
> Updated: 
> <script>
> jQuery(function() {
>   var param1 = 'hello'
>   var param2 = 'world'
>   jQuery('a#mylink').attr('href', '{{=URL("action", args=["' + param1 + 
> '","' + param2 + '"])}}');
> });
> </script>
>
> <h3>{{=A('...', _href='', _id='mylink')}}</h3>
>
>
> On Sun, May 20, 2012 at 4:36 PM, Anthony <abasta...@gmail.com> wrote:
>
>>
>>
>> On Sunday, May 20, 2012 3:43:38 PM UTC-4, Ashraf Mansour wrote:
>>>
>>> thanks for the immediate reply.
>>>
>>> param1 and param2 are determined on the client side.
>>>
>>> how can it be generated by javascript?
>>>
>>>
>> It depends. Here's one example:
>>
>> <script>
>> jQuery(function() {
>>   var param1 = 'hello'
>>   var param2 = 'world'
>>   jQuery('a#mylink').attr('href', '{{=URL("action")}}' + '/' + param1 + 
>> '/' + param2);
>> });
>> </script>
>>
>> <h3>{{=A('...', _href='', _id='mylink')}}</h3>
>>
>> When the page is loaded, the href of the mylink anchor tag will be 
>> replaced with the "action" URL along with the values of param1 and param2 
>> appended. Of course, you'll need some way to set the values of param1 and 
>> param2, and there may be some other event that should trigger the 
>> replacement -- it depends what you're trying to do.
>>
>> Anthony
>>
>>
>
>
> -- 
> -- 
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.fittraineronline.com - Fitness Personal Trainers Online
> http://www.warplydesigned.com
>
>

Reply via email to