var probeReq = new Request.JSON( { url:thisUrl, method: 'get', timeout: AJAX_TIMEOUT, link: 'cancel', onSuccess: getProbeResponse } ); function probe( url_e ) { probeReq.send( "request=add_monitors&action=probe&url="+url_e.value ); } var ProbeResults; 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 += '