Yes, indeed, you are right. I'm wondering why I overlooked such an
obvious thing since I knew about that requirement. Anyway, thanks for
being an extra pair of smart eyeballs.

On Oct 10, 11:51 am, "mr.freeze" <[email protected]> wrote:
> Because the link in the first view doesn't have an id attribute.  Try
> this:
>
> {{=A(T('TEST'),_id="name",_href='#',_class='title',_onclick="ajax
> ('echo',['name'],':eval');")}}
>
> On Oct 10, 2:55 am, weheh <[email protected]> wrote:
>
>
>
> > This doesn't work:
> > -----------
> > # default controller
> > def play():
> >   return dict()
> > def echo():
> >   import random
> >   return "jQuery('#target').html('%s');" % DIV(random.randint(1,100))
>
> > # default view
> > {{extend 'layout.html'}}
> > <div id="target">this is a test</div>
> > {{=A(T('TEST'),_href='#',_class='title',_onclick="ajax('echo',
> > ['name'],':eval')")}}
> > ---------
> > But if I change the default view to the following, both links work
> > when I click on them:
>
> > # default view
> > {{extend 'layout.html'}}
> > <div id="target">this is a test</div>
> > <a href="#" id="name" class="title"
> >    onclick="ajax('echo',['name'],':eval')" >test</a>
> > {{=A(T('TEST'),_href='#',_class='title',
> >   _onclick="ajax('echo',['name'],':eval')")}
>
> > Also, this works, too, when I have just the <a href="#" ... </a> link
> > and no helper.
>
> > # default view
> > {{extend 'layout.html'}}
> > <div id="target">this is a test</div>
> > <a href="#" id="name" class="title"
> >    onclick="ajax('echo',['name'],':eval')" >test</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