0
public function actionajaxSearch() {
$data_fetched=Person::model()->findByAttributes (array('Code'=>'Cust0001'));
echo CJSON::encode($data_fetched); }
$('#searchResult').live('pageshow', function(e,info)
{
$.post('?r=mobile/ajaxSearch',$('form').serialize(),
function(res)
{
arrayvalue =res;
$.each(arrayvalue, function(i, profile) {
alert(i);
alert(profile);
});
}
});
我得到的输出为json编码之一。 在遍历警报我得到的每个字符的值不是按键或值。 有什么帮助吗?ajax json输出解析jquerymobile
你有没有像这样尝试arrayvalue = res.d;并记录阵列值,看看它会帮助你的格式。 – Tamkeen