Got it, thanks. I'll check out this approach.

On Oct 19, 9:54 pm, mdipierro <[email protected]> wrote:
> I your example:
>
> <div id="target"></div>
>  {{=A('a link',
>       _href='#',
>       _id='test',
>       _onclick="ajax('update_target',['test'],':eval');" % id
>       )
>     )}}
>
> The problem is not using A. The problems are:
> - % id but there is not %s in the string
> - the first argument of the ajax function is a relative path and I am
> not sure relative to what, you should use URL
> - the second argument ['test'] assumes that <input id='test'/> and
> tries to pass the value of the input filed but, in your case,
> id='test' is the tag itself so ajax fails.
>
> You can do
>
> <div id="target"></div>
>  {{=A('a link',
>       _href='#',
>       _onclick="ajax('%s',[],':eval');" % URL
> (r=request,f='update_target')
>       )
>     )}}
>
> Massimo
>
> On Oct 19, 7:53 pm, weheh <[email protected]> wrote:
>
>
>
> > Massimo, your example works, although I'm not sure why it does and the
> > original script doesn't? Is it because ajax doesn't find the
> > update_target callback function? I don't see why this would be?
>
> > Anyway, I prefer doing this ajax call via the A() helper since it's
> > embedded in a function call that generates the html. I'm having
> > trouble quoting the strings to get it to work. Could you do a sample
> > of the same call using A()?- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to