var WebDrop = Class.create(); WebDrop.prototype = { initialize: function() { this.garminController = new Garmin.DeviceControl(); this.garminController.register(this); this.garminController.unlock("http://localhost/", ""); this.garminController.findDevices(); }, onFinishFindDevices: function(json) { this.garminController.writeAddressToDevice("180 Harbor Drive, 94965"); }, onFinishedFindLatLon: function(json) { alert("Successfully located " + json.waypoint); }, onFinishWriteToDevice: function(json) { alert("Saved to device favorites list"); }, onException: function(json) { alert("Exception: " + json.msg.message); } };