Code: Select all
{"point" : [132, 30.000, -123.120397], "business" : {"name" : "The Business", "address" : "1234 Some road"}}Moderator: General Moderators
Code: Select all
{"point" : [132, 30.000, -123.120397], "business" : {"name" : "The Business", "address" : "1234 Some road"}}Code: Select all
for(var i in someObject)Code: Select all
function findLocations(conditions){
var conditions = conditions ? conditions : '';
var request = GXmlHttp.create();
request.open("GET", "<?php echo $_GET['url']; ?>/map/find" + conditions, true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
var locations = convertLocationResponse(request.responseText);
}
}
request.send(null);
}
function convertLocationResponse(response){
var locations = new Array();
eval(response);
// Traverse through response, which is just a bunch of json objects in a row
for(var i in /* What goes here? */){
locations[name] = i;
}
return locations;
}Code: Select all
eval(response);
// to
eval('var lljj = ' + response);
for(var i in lljj)...Code: Select all
{"point" : [74, 35.7000007629, -121.5732498169], "business" : {"id" : 30, "name" : "Luke's Crip2", "owner" : "", "contact_name" : "Luke Visinoni", "contact_title" : "", "address" : "1234 Some Way", "address2" : "", "city" : "Pa", "state" : "CA", "zip" : 95969, "phone" : 53677, "alt_phone" : "", "fax" : "", "email" : "lukgn.com", "website" : "", "description_short" : "", "description" : "Some stuff", "season" : "", "hours" : "", "created" : 1158942874, "modified" : 1158942874, "suspended" : "", "county" : "", "type" : "", "keywords" : "", "corridor" : "hwy70", "point_id" : 74}}
{"point" : [72, 30.0000000000, -120.0000000000], "business" : {"id" : 29, "name" : "Luke's Crip", "owner" : "", "contact_name" : "Luke Visinoni", "contact_title" : "", "address" : "", "address2" : "", "city" : "Pa", "state" : "C", "zip" : 95969, "phone" : 5308721677, "alt_phone" : "", "fax" : "", "email" : "l@esign.com", "website" : "", "description_short" : "", "description" : "Some crap", "season" : "", "hours" : "", "created" : 1158940161, "modified" : 1158940161, "suspended" : "", "county" : "", "type" : "", "keywords" : "", "corridor" : "hwy70", "point_id" : 72}}{"point" : [73, 38.1115837097, -121.5732498169], "business" : {"id" : 28, "name" : "The New Splace", "owner" : "", "contact_name" : "Luke Visinoni", "contact_title" : "", "address" : "50n Way", "address2" : "", "city" : "Par", "state" : "CA", "zip" : 69, "phone" : 53077, "alt_phone" : "", "fax" : "", "email" : "lun.com", "website" : "", "description_short" : "", "description" : "Some stuff", "season" : "", "hours" : "", "created" : 1158940000, "modified" : 1158940000, "suspended" : "", "county" : "", "type" : "", "keywords" : "", "corridor" : "hwy99", "point_id" : 73}}
{"point" : [71, 11.0000000000, 99.0000000000], "business" : {"id" : 27, "name" : "Gary Putty", "owner" : "", "contact_name" : "Luke Visinoni", "contact_title" : "", "address" : "04ay", "address2" : "", "city" : "Paradise", "state" : "CA", "zip" : 95969, "phone" : 530877, "alt_phone" : "", "fax" : "", "email" : "luk@ign.com", "website" : "", "description_short" : "", "description" : "Some stuff", "season" : "", "hours" : "", "created" : 1158939652, "modified" : 1158939652, "suspended" : "", "county" : "", "type" : "", "keywords" : "", "corridor" : "i5", "point_id" : 71}}