definitely something is going on with your setup: did you play with routes ?
the default scheme includes the app name right after the host name, and that's why you got the example with /app/controller/function. On Tuesday, September 13, 2016 at 5:38:11 PM UTC+2, Aydin wrote: > > @Niphlod and Brian: > Sorry that was my mistake, I mixed up the codes. > the actual code was: > > <script> > $.getJSON('/application/default/getdata', > function(data){series: [{ > type: 'area', > name: 'x', > data: data > }] > }); > > > So since it looked like there was no error in the procedure, I played with > the URL argument a bit and what worked for me was /default/getdata. I don't > know why when I added application name it was not working. > I confirmed that it works with both /default/getdata > and /default/getdata.json. > Anyways, it seems that the application name should not be in the url > argument. > > On Tuesday, September 13, 2016 at 10:05:58 AM UTC-4, Niphlod wrote: >> >> then please check with whoever wrote >> >> """ >> >> function(data){series: [{ >> type: 'area', >> name: 'Response(kW)', >> data: data >> }] >> >> """ >> >> PS: may I suggest that you'd need to call /app/default/getdata*.json *that >> sets automatically also the correct content-type for json ? >> >> On Tuesday, September 13, 2016 at 1:39:19 PM UTC+2, Aydin wrote: >>> >>> Im sure it has to do with my code not web2py. >>> Yes in the browser i did /app/default/getdata and it returned correctly >>> [[1,2],[2,3]]. >>> By the way i import json and also use @service.json. >>> >> -- 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.