
=head1 NAME

Nes::Obj::pseudo_ajax - cross-domain pseudo-AJAX requests.

=head1 SYNOPSIS

    {: include ('{: * cfg_obj_top_dir :}/Nes/ajax/pseudo_ajax.nhtml',
                "
                  js_file            => 'http://any-domain/file.js', 
                  script             => '/* Js script */',
                  script_tpl         => 'js-script.nhtml',

                  lparam => 
                          {  
                            varname  => 'literal', 
                            {: # more params ... :}
                          },
                  vparam => 
                          {  
                            varname  => 'JsVariable', 
                            {: # more params ... :}
                          },                          

                  events => 
                        [    
                          {  
                            event     => 'onBlur', 
                            by        => 'field',
                            idname    => 'fieldname',
                            preload   => 'preloadJsFunction',
                            afterload => 'afterloadJsFunction',
                            lparam => 
                                     {
                                        varname  => 'literal',
                                        {: # more params ... :}
                                     },
                            vparam => 
                                     {
                                        varname  => 'JsVariable',
                                        {: # more params ... :}
                                     },                                     
                          },
                           {: # more events ... :}
                        ],
                "
               )    
    :}

=head1 DESCRIPTION

Emulate AJAX requests on a JS file. Can be only GETs (not POST) on js files.
JS file can be generated with Nes (njs files). Its only advantage is that you
can do cross-domain.

=head1 PARAMETERS

=over 2

=item js_file.js

Js o njs file to GET.

=item script

JavaScript to add to that generated by the object. 

=item script_tpl

Template with JavaScript to add to that generated by the object.

=item lparam => varname = value

Variable to pass in GET to js file, is a literal JS value, does not
interpreted by JavaScript. ( file.js?varname=value )

=item vparam => varname = value

Variable to pass in GET to js file, is a JS variable, interpreted by JavaScript.

=item events

JavaScript events.

=item events => event

JavaScript associated event of the request.

=item events => by

JavaScript object that generates the event. Can be: field, name, id or tag. 
Field is a field form, Name is a name property of tag, Id is a id property of
tag and Tag is name of tag.

=item events => idname

The name of the field, name, id or tag in events => by.

=item events => preload

JavaScript function to call before load js file.

=item events => afterload

JavaScript function to call after load js file.

=item events => lparam => varname = value

Variable to pass in GET to js file, is a literal JS value, does not
interpreted by JavaScript.

=item events => vparam => varname = value

Variable to pass in GET to js file, is a JS variable, interpreted by JavaScript.

=back

=head1 AUTHOR

Skriptke: Enrique Castañón

=head1 VERSION

Version 1.03 April 2010

=head1 COPYRIGHT

Copyright (c) Enrique F. Castanon Barbero. All rights reserved.

=head1 LICENSE

This program is free software; you can redistribute it
and/or modify it under the same terms and conditions as
GNU Public License (GPL).

This means that you can, at your option, redistribute it and/or 
modify it under either the terms the GNU Public License (GPL), 
or under the Perl Artistic License.

See http://dev.perl.org/licenses/

=head1 DISCLAIMER

THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.

Use of this software in any way or in any form, source or binary,
is not allowed in any country which prohibits disclaimers of any
implied warranties of merchantability or fitness for a particular
purpose or any disclaimers of a similar nature.

IN NO EVENT SHALL I BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL,  OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION (INCLUDING, BUT NOT
LIMITED TO, LOST PROFITS) EVEN IF I HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE

=head1 SEE ALSO

L<Nes>, L<Nes::Tutorial>, L<Nes::Singleton>, L<Nes::nes.cfg>, 
Sample to use Nes; L<http://nes.sourceforge.net/>

=cut

