Hello, I am trying to make an AJAX call to a TG2 controller that returns JSON.
I can see the data on the web browser when URL is specified on it. But when I try to call the URL via AJAX using XMLHttpRequest, I am unable to see the data from the Java script. Server console output shows controller was called. There are no security or permission being set for the controller access. TG controller code -------------------------- @expose('json') def get_one(self, id): print "I am called" return dict(a=1) javascript ------------- xmlhttp.onreadystatechange = function() { alert(xmlhttp.status) // STATUS is always 0 alert(xmlhttp.responseText) // Response text is always empty } xmlhttp.open("GET","http://192.168.1.81:8080/listing/get_one?id=1", false); xmlhttp.send(); TG console output --------------------------- 02:46:58,333 INFO [gearbox] Starting server in PID 30110. Starting HTTP server on http://192.168.1.81:8080 I am called 192.168.1.70 - - [08/Dec/2014 02:47:03] "GET /listing/get_one?id=1 HTTP/1.1" 200 8 Can anyone tell me what I am doing wrong here ? Regards Mark -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To unsubscribe from this group and stop receiving emails from it, send an email to turbogears+unsubscr...@googlegroups.com. To post to this group, send email to turbogears@googlegroups.com. Visit this group at http://groups.google.com/group/turbogears. For more options, visit https://groups.google.com/d/optout.