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 <richard_gor...@verizon.net> 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> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---