This simple function can make a detection:
def isAjax():
if request.env.http_x_requested_with==None:
return False
if
request.env.http_x_requested_with.lower()=='XMLHttpRequest'.lower():
return True
else:
return False
This could be a part of web2py core.
David
On 3 srp, 13:13, szabba <[email protected]> wrote:
> On 3 Sie, 12:43, David Marko <[email protected]> wrote:
>
> > I dont use LOAD, I simply call controller function from browser using
> > jQUERY $("#ID").load("URL to controller function") and in controller i
> > have to detect this ajax call
>
> You could use a query or path argument - just replace "/a/c/f" with
> "/a/c/f?ajax=true" or "/a/c/f/ajax".
>
> szabba