my $url = $opt{'url'};
my $method = exists($opt{'method'}) ? $opt{'method'} : 'GET';
#my @subs = @{ $opt{'subs'};
+ my $key = exists($opt{'key'}) ? $opt{'key'} : '';
$url .= ( ($url =~ /\?/) ? '&' : '?' )
if $method eq 'GET';
%>
- function <%=$func%>() {
+ function <%=$key%><%=$func%>() {
// count args; build URL
var url = "<%=$furl%>";
- var a = <%=$func%>.arguments;
+ var a = <%=$key%><%=$func%>.arguments;
var args;
var len;
var data = xmlhttp.responseText;
//alert('received response: ' + data);
a[a.length-1](data);
+ if ( data.indexOf("<b>System error</b>") > -1 ) {
+ var w;
+ if ( w = window.open("about:blank") ) {
+ w.document.write(data);
+ } else {
+ // popup blocking? should use an overlib popup instead
+ alert("Error popup disabled; try disabling popup blocking to see");
+ }
+ }
}
}