X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fxmlhttp.html;h=a9e65c79092bef5d156622d980b7d2284b1d1206;hb=a72a10f754f7465121d6137bb3dcee0a21ea6443;hp=41965ace204c10acd5b0daf0838d7fdc77ae6898;hpb=76161f1a2ae0f96470bed4089b00eff5abb16cff;p=freeside.git diff --git a/httemplate/elements/xmlhttp.html b/httemplate/elements/xmlhttp.html index 41965ace2..a9e65c790 100644 --- a/httemplate/elements/xmlhttp.html +++ b/httemplate/elements/xmlhttp.html @@ -1,79 +1,124 @@ -<% - my ( %opt ) = @_; +<%doc> - my $url = $opt{'url'}; - #my $action = exists $opt{'action'} ? $opt{'action'} : 'GET'; - #my @subs = @{ $opt{'subs'}; +Example: - $url .= ( ($url =~ /\?/) ? '&' : '?' ). - 'sub='; + 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 - +<%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'; + +