HTML::Prototype::Js is a prototype library, embedded in Perl.
SYNOPSIS
our $prototype = do { package HTML::Prototype::Js; local $/; < DATA > };
This is the actual Prototype library embedded in a perl __DATA__ section, for easy inclusion in HTML::Prototype.
NEW SYNTAX
The prototype library provides some functions and classes which effectively change the basic syntax of the JavaScript you write.
$(element)
This function takes an element / element list and gets all string elements using document.getElementbyId. This is probably one of the most common functions when using javascript for web development, so it will save you a lot of typing.
Class
This uses fucntion references to allow namespace-like Class structures in javascript.
Object.extend
Simple inheritance for javacsript. Will set all properties of the child in the parent.
Function.bind
Allow function refs to be full object method references, through the use of extend and apply
Try.these
Simple try/catch for a list of functions, will return the return value of the first that doesn't throw an exception.
Array.push
implement push for arrays. returns number of elements in result.
Function.apply
Call a function on a given object, using eval.
Product's homepage
Requirements:
· Perl