X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fxmlhttp.html;h=2f4f0d555146ccb4c871de6db61cf9c99357f0c7;hb=796780078517c26803a7689ccd80931381de23ea;hp=425e28e3d437b9631aeead40b2f45e5796e179d3;hpb=9e342300c380e29af1b9678f1a9604609e0061b6;p=freeside.git diff --git a/httemplate/elements/xmlhttp.html b/httemplate/elements/xmlhttp.html index 425e28e3d..2f4f0d555 100644 --- a/httemplate/elements/xmlhttp.html +++ b/httemplate/elements/xmlhttp.html @@ -1,65 +1,126 @@ -<% - my ( $url, @subs ) = @_; +<%doc> - $url .= ( ($url =~ /\?/) ? '&' : '?' ). - 'sub='; +Example: -%> + include( '/elements/xmlhttp.html', + # required + 'url' => $p.'misc/something.html', + 'subs' => [ 'subroutine' ], + # optional + 'method' => 'GET', #defaults to GET, could specify POST + 'key' => 'unique', #unique key + + ); + + +<%shared> +my %initialized = ();#won't work if component is "preloaded"... so don't do that + +<& /elements/rs_init_object.html &> +<& /elements/init_overlib.html &> +<%init> +my ( %opt ) = @_; + +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'; + +