KHARMA JSON // 1. JSON representation of a placemark with a balloon var myFeatureJSON =! { balloonVisibility : "1", description : "function balloon_relative_init(){console.debug('balloon relative init'); folder_test()}; Example balloon relative to device", iconVisibility : "1", id : "balloon_relative", labelVisibility : "0", name : "Balloon Relative", }; type : "placemark", visibility : "1", parent : "folder", extendedData : { id : "asfasfasdf", type : "extendeddata", data : [{ type : "data", Data_name : "tag", DisplayName : "the hash", value : "aelatgt"}, { type : "data", Data_name : "value", value : "2" }] }, geometry : [{ altitudeMode : "clampToGround", id : "balloon3”, location : { altitude : "0", id : "location_relative", latitude : "6", latitude_units : "meters", longitude : "0", type : "location", parent : "balloon3” }, locationMode : "relative", locationMode_targetId : "clampToGround", orientationMode : "clampToGround", orientationMode_targetId : "clampToGround", scaleMode : "clampToGround", type : "balloon", parent : "balloon_relative" }] // 2. use JSON to create dynamically create placemark var myFeature = new KMLPlacemark(myFeatureJSON); // 3. getting a handle to the object later var myReference = KHARMA.getKMLElementByID("balloon_relative");
AJAX var url = 'http://twitter.com/firehose'; var req = new XMLHttpRequest(); req.onReadyStateChange = function () { ! if (req.readyState === 4) { ! ! ! var data = req.responseText; ! ! ! // process the data ! ! } } req.open('GET', url, true); req.send(null);