var ProbeResults; function probe( url_e ) { $j.getJSON(thisUrl + '?view=request&request=add_monitors&action=probe&url=' + url_e.value) .done(getProbeResponse) .fail(logAjaxFail); } function getProbeResponse( respObj, respText ) { if ( checkStreamForErrors( "getProbeResponse", respObj ) ) { return; } if ( respObj.Streams && respObj.Streams.length ) { parseStreams( respObj.Streams ); } else { var results_div = $j('#results')[0]; if ( ! results_div ) { console.log("No results div found."); return; } results_div.innerHTML = 'No streams found.'; //console.log("No streams: " + respText); } } // end function getProbeResponse function parseStreams( Streams ) { ProbeResults = Array(); var results_div = $j('#results')[0]; if ( ! results_div ) { console.log("No results div found."); return; } results_div.innerHTML = ''; var html = ''; for ( i in Streams ) { var stream = Streams[i]; if ( stream.url ) { html += '
'+stream.Monitor.Name + ' at ' + stream.url;
if ( stream.Monitor.Id ) {
html += ' is already entered into the system by Monitor ' + stream.Monitor.Id + ' ' + stream.Monitor.Name + '
';
html += '';
} else {
html += '';
}
html += '