a taddle bit of recap, seems that you're loosing the bigger picture .... ANYTHING (or, the 99%) of things in views contained in a {{=blabla}} are properly escaped.
Back to the "problem": - first of all, you shouldn't generate <p id="target"></p> multiple times. Every element with an id attribute should be the only instance in the page - second: you'd really check into what leonel suggested, it cuts the complexity - third, for completeness sake and for that only: in cases like this I like to take a step back and iterate over small changes, to see where everything is falling apart... a) let's start with <div onlick="something">check about</a> b) let's get "something" become "ajax('url', ['parameter'], 'target');" - <div onlick="ajax('url', ['parameter'], 'target')">check about</a> c) let's get "url" become a proper url - <div onlick="ajax('{{=URL('default','about_group')}}', ['parameter'], 'target')">check about</a> d) let's get "parameter" become the row.id - <div onlick="ajax('{{=URL('default','about_group')}}', ['{{=row.id}}'], 'target')">check about</a> voilà, no syntax errors. On Tuesday, March 29, 2016 at 12:56:20 PM UTC+2, Jacob Devin wrote: > > now it says: > <type 'exceptions.SyntaxError'> unexpected character after line > continuation character (default/index.html, line 83) > > earlier it was giving no response on clicking as i expected it to work as > per its onclick function. > > On Tuesday, March 29, 2016 at 4:10:02 PM UTC+5:30, Kiran Subbaraman wrote: >> >> Escaping the inner-quotes: <div >> onclick="ajax('{{=URL(\'default\',\'about_group\')}}',[row.id >> ],'target');"> >> Also will be a good idea to see what sort of errors appear on your >> browser's console, and if the generated page contains the callback url that >> you expect. >> >> ________________________________________ >> Kiran Subbaramanhttp://subbaraman.wordpress.com/about/ >> >> On Tue, 29-03-2016 3:59 PM, Jacob Devin wrote: >> >> >> {{extend 'layout.html'}} >> {{for row in rows:}} >> <h3> >> {{=row.name}} >> </h3> >> <br> >> <div >> onclick="ajax('{{=URL('default','about_group')}}',[row.id],'target');">check >> 'about' >> </div> >> <p id='target'> </p> >> {{pass}} >> >> >> >> def index(): >> rows=db(db.groups.id>0).select() >> return locals() >> def about_group(): >> row=db(db.groups.id >> <http://www.google.com/url?q=http%3A%2F%2Fdb.groups.id&sa=D&sntz=1&usg=AFQjCNGyoPAiL5aO9CxjYARm6g5WaR7gag> >> ==request.vars.row.id).select().first() >> return row.about >> It ain't working with div onclick too. What's the problem now? >> >> On Tuesday, March 29, 2016 at 3:48:50 PM UTC+5:30, Leonel Câmara wrote: >>> >>> It shouldn't be on href it should be on onclick. >>> >>> Consider using a trapped link for that instead. >>> >>> http://web2py.com/books/default/chapter/29/12/components-and-plugins#Trapped-Ajax-links-and-the-A-Helper >>> >> -- >> Resources: >> - http://web2py.com >> - http://web2py.com/book (Documentation) >> - http://github.com/web2py/web2py (Source code) >> - https://code.google.com/p/web2py/issues/list (Report Issues) >> --- >> You received this message because you are subscribed to the Google Groups >> "web2py-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to web2py+un...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> >> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.