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 previewProperti es = new PreviewProperti es();
previewProperti es = tripPreviewProp erties(id);
//Need to Display lat,lon & scale
//alert(previewPr operties.lat); This Does Not Work
}
//Preview Properties Object
function PreviewProperti es(lat,lon) {
this.lat = lat;
this.lon = lon;
this.scale =4;
}
function tripPreviewProp erties(id)
{
AjaxCommon.Goog leMapsTripPrevi ewProperties(id ,tripPreviewPro perties_callbac k);
}
function tripPreviewProp erties_callback (res)
{
properties = new PreviewProperti es(res.value.La t,res.value.Lon );
// Corect Properties are Displayed
alert(propertie s.lat + "\n" + properties.lon );
return properties;
}