// retrieve site notes function displaySiteNotes( _site ) { var xhttp; // build parameters list var params = { site : _site, } if ( _site.length > 0 ) { // async call to php xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { try { // parse json formatted response var data = JSON.parse(this.responseText); if ( data.length > 0 ) { for (var i in data) { // pre-processing ( deviation determination ) data[i][0] // notes data[i][1] // height } }catch(e) { //alert(e); } } }; xhttp.open("GET", "./siteNotes.php" + formatParams(params), true); xhttp.send(); } }