function match(sSource, sMatch) { sSource = /^.*sSource.*$/; var wildcardRight = false; if (sMatch.charAt(sMatch.length - 1) == "*") { wildcardRight = true; sMatch = sMatch.substring(0, sMatch.length - 1); } if (wildcardRight) { return (sSource.indexOf(sMatch) == 0); } else { return sSource == sMatch; } } int_Counter = 0; function getPageContent(str_Url, str_Id) { new Ajax.Request(str_Url, { method: 'get', requestHeaders: { 'Pragma': 'no-cache', 'Cache-Control': 'must-revalidate', 'If-Modified-Since': 'document.lastModified' }, onLoading: function(Element) { $(str_Id).update(''); }, onComplete: function(Element) { str_Response = Element.responseText; if (str_Response.match('array_slice()') && int_Counter < 80 || str_Response == '' && int_Counter < 80) { int_Counter = int_Counter+1; getPageContent(str_Url, str_Id); } else { $(str_Id).update(str_Response); } } }); }