[web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread PlanetUnknown
Trying to make a simple ajax call from the view back to the controller. It is working, however the data I'm sending isn't coming in the request.vars if I sent the contentType=application/json. I know there is an internal ajax function, but I have my own library with these functions I'd like to

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Bruno Rocha
Your URL should have the vars url: /test01/default/getContent?sourcetitle=xxx If you do not pass the vars on url you can't get them at the called controller --

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Nik
Thanks Bruno ! That worked, but now when I get the response back as JSON, JQuery throws an error saying the JSON isn't valid. The JSON seems valid to me also passes JSONLint test : {readyState:4,responseText:FIFA support India for U-17 and 2022 World Cup - Times,status:200,statusText:OK}

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Bruno Rocha
or you call it with .json extension and use the generic json view url: /test01/default/getContent*.json*?sourceTitle=x or you do this on the return import json def getContent(): titleArg = str(request.vars.sourceTitle) print -- print

Re: [web2py] Web2Py : JQuery .ajax data sent not present in request.vars

2012-09-05 Thread Nik
That worked too ! You rock :) On Wednesday, 5 September 2012 17:58:16 UTC-4, rochacbruno wrote: or you call it with .json extension and use the generic json view url: /test01/default/getContent*.json*?sourceTitle=x or you do this on the return import json def getContent(): titleArg