Sorry, I'm sure I wasn't clear. The routine I posted does not work. The parent div is properly updated, however the alert is not executed. I want the alert to be executed without further action by the user.
On Dec 23, 7:02 pm, Michele Comitini <michele.comit...@gmail.com> wrote: > I do not know what criteria you would use to understand if #parent is > acceptable or not but you > can pass as many other ids as you need: > > DIV(A('click me',_href='#',_id='parent',_onclick("ajax('clickback', > ['parent', '2nd', '3rd', ... 'nth'],':eval');"))) > > #controller > def clickback(): > for t in args: > if kosher(t): > target = t > return 'jQuery("#" + target).html("%s");' %\ > SCRIPT("alert('hello world');") > > 2010/12/24 weheh <richard_gor...@verizon.net>: > > > How would I do this? > > #view > > DIV(A('click me',_href='#',_id='parent',_onclick("ajax('clickback', > > ['parent'],':eval');"))) > > > #controller > > def clickback(): > > return 'jQuery("#parent").html("%s");' %\ > > SCRIPT("alert('hello world');") > > > So that when I click on "click me" it calls the clickback, which > > inserts the alert on top of the same parent. If overwriting one's > > calling div isn't kosher, then I'm OK targeting a second div. > >