Hi,
I use following JQuery request:
jQuery('body').undelegate('#closeUpdateDialog','click').delegate('#closeUpdateDialog','click',function(){
jQuery.ajax({'success': function(data) {
$('#mymessage').text(typeof data);
$('#quote-form-2')[0].reset();
$('#egz').dialog('close');
},
'type':'POST','url':'/erfassungswerkzeug/index.php?r=quote/update&id=' + source_id,
'cache':false,
'data':jQuery(this).parents('form').serialize()}
);
return false;
});
The QuoteController returns a response via JSON:
echo CJSON::encode(array('saved' => true,
'div' => 'Citation was updated.'));
Yii::app()->end();
I can see in Firebug, that the controller returns following key value pairs:
saved true
div "Citation was updated."
But I am not able to get the key and value pair inside the function(data) and $(’#mymessage’).text(typeof data); returns that the type of data is ‘String’. What I am doing wrong here?
– Franck