Hello,
I use tooltipster extension in my site and I want to change the content via ajax. This is my code:
echo CHtml::link('Text', '#', array('id' => 'test'));
$this->widget('ext.tooltipster.tooltipster',
array(
'identifier' => '#test',
'options' => array(
'position' => 'right',
'trigger' => 'click',
'interactive' => true,
'content' => 'Loading...',
'theme'=>'.my-custom-theme',
'functionBefore' => 'js:function(origin, continueTooltip) {
continueTooltip();
$.ajax({
type: "GET",
url: "'.Yii::app()->createUrl('/xx/someAction', array('id' => $id)).'",
success: function(data) {
origin.tooltipster("update", data);
}
});
}',
)
));
But the content doesn’t change and I can’t understand what I’m doing wrong. I really need a suggestion. Thanks!