public function addJavaScriptAttribute($jsObject, $jsAttrName, $attrParam)
	{
		if (!is_array($attrParam))
		{
			$attrParam = array($attrParam);
		}
		
		$jsEventSource = 
			"$(function() { \n" . 
			"   $('$jsObject').$jsAttrName({ \n";
		
		$first = true;
		foreach ($attrParam as $key=>$value)
		{
			$jsEventSource .= (!$first ? ",\n" : "") . "      " . (!is_numeric($key) ? "$key: " : "" ) . $value;
			$first = false;
		}
		
		$jsEventSource .= 
			"\n   }); \n" .
			"});\n\n";
		
		$this->addJavaScriptSource($jsEventSource, false);
	}
public function addJavaScriptAttribute($jsObject, $jsAttrName, $attrParam)
	{
		if (!is_array($attrParam))
		{
			$attrParam = array($attrParam);
		}
		
		$jsEventSource = 
			"$(function() { \n" . 
			"   $('$jsObject').$jsAttrName({ \n";
		
		$first = true;
		foreach ($attrParam as $key=>$value)
		{
			$jsEventSource .= (!$first ? ",\n" : "") . "      " . (!is_numeric($key) ? "$key: " : "" ) . $value;
			$first = false;
		}
		
		$jsEventSource .= 
			"\n   }); \n" .
			"});\n\n";
		
		$this->addJavaScriptSource($jsEventSource, false);
	}
public function addJavaScriptAttribute ( $ jsObject , $ jsAttrName , $ attrParam ) { if ( ! is_array ( $ attrParam ) ) { $ attrParam = array ( $ attrParam ) ; } $ jsEventSource = "$(function() { \n" . "   $('$jsObject').$jsAttrName({ \n" ; $ first = true ; foreach ( $ attrParam as $ key => $ value ) { $ jsEventSource .= ( ! $ first ? ",\n" : "" ) . "      " . ( ! is_numeric ( $ key ) ? "$key: " : "" ) . $ value ; $ first = false ; } $ jsEventSource .= "\n   }); \n" . "});\n\n" ; $ this -> addJavaScriptSource ( $ jsEventSource , false ) ; }
Add a JavaScript attribute to a JavaScript object.

Some examples:

addJavaScriptMethod("#myID", "someAttr", array("param"=>"'teste'"));

@param string $jsObject
@param string $jsAttribute
@param array $attrParam
@return void
Add a JavaScript attribute to a JavaScript object .