S
stuartshay
Hello All:
I am trying to figure out how to use objects properties in my code so
when the page loads All my properties are in object where I can use
elsewhere in my page.
I am new to JavaScrip Objects so any help would be appreciated.
Thanks
SPS
function onload()
{
var id = 25;
var previewProperties = new PreviewProperties();
previewProperties = tripPreviewProperties(id);
//Need to Display lat,lon & scale
//alert(previewProperties.lat); This Does Not Work
}
//Preview Properties Object
function PreviewProperties(lat,lon) {
this.lat = lat;
this.lon = lon;
this.scale =4;
}
function tripPreviewProperties(id)
{
AjaxCommon.GoogleMapsTripPreviewProperties(id,tripPreviewProperties_callback);
}
function tripPreviewProperties_callback(res)
{
properties = new PreviewProperties(res.value.Lat,res.value.Lon);
// Corect Properties are Displayed
alert(properties.lat + "\n" + properties.lon );
return properties;
}
I am trying to figure out how to use objects properties in my code so
when the page loads All my properties are in object where I can use
elsewhere in my page.
I am new to JavaScrip Objects so any help would be appreciated.
Thanks
SPS
function onload()
{
var id = 25;
var previewProperties = new PreviewProperties();
previewProperties = tripPreviewProperties(id);
//Need to Display lat,lon & scale
//alert(previewProperties.lat); This Does Not Work
}
//Preview Properties Object
function PreviewProperties(lat,lon) {
this.lat = lat;
this.lon = lon;
this.scale =4;
}
function tripPreviewProperties(id)
{
AjaxCommon.GoogleMapsTripPreviewProperties(id,tripPreviewProperties_callback);
}
function tripPreviewProperties_callback(res)
{
properties = new PreviewProperties(res.value.Lat,res.value.Lon);
// Corect Properties are Displayed
alert(properties.lat + "\n" + properties.lon );
return properties;
}