I am trying to create an ajax function with all the data inside the following variable inside the following function: $item
public function onK2AfterDisplayContent(&$item,&$params,$limitstart)
{
$view = JRequest::getVar('view');
if($view === 'item'){
$db = JFactory::getDbo();
$query = 'SELECT name FROM #__k2_categories WHERE id='.$item->catid;
$db->setQuery($query);
$resultado = $db->loadResult();
echo '<input class=subscribete type=button id='.$resultado.'-'.$item->id.' value="Subscribete" />';
}
}
Im not sure if instead of using a <button>
I should use an html link. The variable $item
is an object with a lot of information which I want to take to my AJAX for later treating this data...