address standardization part one, finally checked in from here
[freeside.git] / httemplate / elements / xmlhttp.html
index 6efc395..d0c7990 100644 (file)
@@ -1,17 +1,19 @@
-%
-%  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';
-%
-%
+<%doc>
+
+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
+
+  );
+
+</%doc>
 <SCRIPT TYPE="text/javascript">
 
   function rs_init_object() {
 
 
 </SCRIPT>
+<%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';
+
+</%init>