Hello,
I would like to use the callback parameter to call my client-side js
instead of replacing the content of an element.
In the web2py.js I've found that the ajax() function makes it possible in
the else part:
jQuery.ajax({type: "POST", url: u, data: query, success: function(msg) { if(
t) { if(t==':eval') eval(msg); else if(typeof t=='string') jQuery("#"+t).
html(msg); else t(msg);} } });
So if the type of the target is not string thhen I'm OK.
But I've found this in the A helper:
self['_onclick']="ajax('%s',[],'%s');%sreturn false;" % \
(self['callback'],self['target'] or '',d)
The single quotes are there regardless the type of target.
So how can I specify any target of type other than string?
Yes I know if I use ':eval' and I return "myFunction('param')" then it will
evaluate it, but the question is not that :)
How can I get into the "else" section of the quoted js code?
Many thanks,
Gergely