I'm trying to glue these 2 pieces together, I don't even know where the problem is, there is no alert() and firebug does not tell me anything.
// django with yellow api to find_business search:
// ----------------------
def get_yellow(request):
mimetype = 'application/json'
yapi = YellowAPI(settings.YELLOW_API_KEY, test_mode=True, format='JSON', handlers=[])
data = yapi.find_business(what='403-253-0395', where='Calgary', uid='127.0.0.1')
print data #I can see here there is a result
return HttpResponse(data,mimetype)
// jQuery
// ----------------------
$(document).ready(function(){
$.getJSON('http://myserver:8000/get_yellow/',
function(data) {
alert('Fetched ' + data.length + ' items!');
})
});
// I'm including a full response on a simple call, is this a valid json?
// ----------------------
{"summary":{"what":"403-253-0395","where":"Calgary","latitude":"","longitude":"","firstListing":1,"lastListing":1,"totalListings":1,"pageCount":1,"currentPage":1,"listingsPerPage":40},"listings":[{"parentId":"","isParent":false,"distance":"","content":{"Video":{"avail":false,"inMkt":false},"Photo":{"avail":false,"inMkt":false},"Profile":{"avail":false,"inMkt":false},"DspAd":{"avail":false,"inMkt":false},"Url":{"avail":false,"inMkt":false},"Logo":{"avail":false,"inMkt":false}},"id":"1931218","name":"Future Shop","address":{"street":"1180-33 Heritage Meadows Way SE","city":"Calgary","prov":"AB","pcode":"T2H3B8"},"geoCode":{"latitude":"50.987988","longitude":"-114.04424"}}]}