dudeshouse
07-24-2009, 05:01 PM
Hi,
Firstly I'd like to say I'm fairly new at this. I know ASP well, but php and advanced javascript phase me... On that note...
What I'm trying to do is pick apart a site I've been handed, which was put together using the Zend framework, which doesn't help my case at all as trying to pick that apart isn't fun at the best of times.
I'm trying to translate a Google map using JSON and php, into ASP. The whole site is being redeveloped, and being an ASP programmer, this is just how it is.
The call that is being made is as follows:
function getPossible(){
$("#console").text("Loading ... ");
// $.getJSON("/directory/query?border="+map.getBounds()+"&facilities="+selected_facilities,
$.getJSON("/pubs/directory-query.asp?border="+map.getBounds()+"&facilities="+selected_facilities,
function(data){
clearPubs();
$("#console").text("Loaded "+data.count + " pubs maching your criteria");
for(i in data){
if(data[i].id > 0 ){
var point = new GLatLng( parseFloat(data[i].lat),parseFloat(data[i].long));
if( data[i].id == selected_pub_id){
var marker = createFlashMarker(point,'<b>'+data[i].name+'</b><Br/>'+'<a href="'+data[i].link+'">view details</a><br />'+data[i].address+'<br />'+data[i].postcode +', '+ data[i].town_name + '<br /> phone:'+data[i].phone+'<br />',data[i].name + "");
}else{
var marker = createMarker(point,'<b>'+data[i].name+'</b><br/>'+'<a href="'+data[i].link+'">view details</a><br />'+data[i].address+'<br />'+data[i].postcode +', '+ data[i].town_name + '<br />phone:'+data[i].phone+'<br />',data[i].name + "");
}
map.addOverlay(marker);
}
}
});
}
I think I'm understanding most of this now.
You will see that I'm calling the .asp page now and it's then getting the data from the database.
What I'm failing at is how to pass it back to this call, so that it can be used by the function(data) part.
I've tried returning a created array, I've tried returning a string along the lines of "[id,1,long,53,lat,51....]" as well as using {} around it.
I tried the string approach as Zend seemed to be encoding the output this way.
If anyone can help, that would be great. At present, the console doesn't get past showing "Loading..." so I reckon it's something I'm doing wrong regarding passing the data back from the asp page.
Thanks in anticipation....
Glenn
Firstly I'd like to say I'm fairly new at this. I know ASP well, but php and advanced javascript phase me... On that note...
What I'm trying to do is pick apart a site I've been handed, which was put together using the Zend framework, which doesn't help my case at all as trying to pick that apart isn't fun at the best of times.
I'm trying to translate a Google map using JSON and php, into ASP. The whole site is being redeveloped, and being an ASP programmer, this is just how it is.
The call that is being made is as follows:
function getPossible(){
$("#console").text("Loading ... ");
// $.getJSON("/directory/query?border="+map.getBounds()+"&facilities="+selected_facilities,
$.getJSON("/pubs/directory-query.asp?border="+map.getBounds()+"&facilities="+selected_facilities,
function(data){
clearPubs();
$("#console").text("Loaded "+data.count + " pubs maching your criteria");
for(i in data){
if(data[i].id > 0 ){
var point = new GLatLng( parseFloat(data[i].lat),parseFloat(data[i].long));
if( data[i].id == selected_pub_id){
var marker = createFlashMarker(point,'<b>'+data[i].name+'</b><Br/>'+'<a href="'+data[i].link+'">view details</a><br />'+data[i].address+'<br />'+data[i].postcode +', '+ data[i].town_name + '<br /> phone:'+data[i].phone+'<br />',data[i].name + "");
}else{
var marker = createMarker(point,'<b>'+data[i].name+'</b><br/>'+'<a href="'+data[i].link+'">view details</a><br />'+data[i].address+'<br />'+data[i].postcode +', '+ data[i].town_name + '<br />phone:'+data[i].phone+'<br />',data[i].name + "");
}
map.addOverlay(marker);
}
}
});
}
I think I'm understanding most of this now.
You will see that I'm calling the .asp page now and it's then getting the data from the database.
What I'm failing at is how to pass it back to this call, so that it can be used by the function(data) part.
I've tried returning a created array, I've tried returning a string along the lines of "[id,1,long,53,lat,51....]" as well as using {} around it.
I tried the string approach as Zend seemed to be encoding the output this way.
If anyone can help, that would be great. At present, the console doesn't get past showing "Loading..." so I reckon it's something I'm doing wrong regarding passing the data back from the asp page.
Thanks in anticipation....
Glenn