HTML-Prototype
view release on metacpan or search on metacpan
lib/HTML/Prototype.pm view on Meta::CPAN
$prototype->update_element_function( 'cart', {
action => 'update',
position => 'bottom',
content => "<p>New Product: $product_name</p>"
} );
$prototype->update_element_function( 'status',
{ binding => "You've bought a new product!" } );
=cut
sub update_element_function {
my ( $self, $element_id, $options, $code ) = @_;
$options ||= {};
my $content = $options->{content} || '';
$content = &$code if $code;
my $action = $options->{action} || $options->{update};
my $javascript_function = '';
if ( $action eq 'update' ) {
if ( my $position = $options->{position} ) {
$position = ucfirst $position;
$javascript_function =
( run in 0.542 second using v1.01-cache-2.11-cpan-e1769b4cff6 )