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; //alert(respText); if ( respObj.Streams ) { parseStreams( respObj.Streams ); } else { alert("No Streams"); } } // end function getProbeResponse function parseStreams( Streams ) { ProbeResults = Array(); var results_div = $j('#url_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.url;
if ( stream.Monitor.Id ) {
html += ' is already entered into the system by Monitor ' + stream.Monitor.Id + ' ' + stream.Monitor.Name + '
';
html += '';
} else {
html += '';
}
html += '