JavaScript Class
Provides functionality for working with JavaScript.
Initializing the Class
Initialize this class like any other class.
$javascript= new JavaScript();
Then use any of the meber functions given below.
button_to_function($name,$function=null)
Returns a link that’ll trigger a JavaScript function using the onclick handler.
Example :
button_to_function('Greetigs', 'alert("Hello world!")' );
escape($javascript)
Escape carrier returns and single and double quotes for JavaScript segments.
tag($content)
Returns a JavaScript tag with the content inside.
Example :
tag('alert("All is good")');
link_to_function($name,$function,$html_options=null)
Returns a link that’ll trigger a JavaScript function using the onclick handler and return false after the fact.
Example :
link_to_function("Greeting","alert('Hello world!')");