2011-05-20 8 views
0

が、これは私のコードです:アヤックスデータは私のスクリプトで定義されていない

function(id) {      
id=$.fn.yiiGridView.getSelection(id); 
console.log(id);        
jQuery.ajax({ 
'url':'/index.php?r=client/loadOne', 
'data':id, 
'cache':false, 
'success':function(html){jQuery(
".portlet-60 .portlet-content") 
.html(html)}}); 

、それがコンソールに私にこの出力を取得します:コンソールでのIDは「2に等しく、なぜ私は理解していない

["2"] 
index.phpGET http://127.0.0.4/index.php?r=client/loadOne&undefined=undefined 500 (PHP Error) 

"、ajaxデータのバグは未定義です。

答えて

1

データは

+0

あなたは私のコードの文字列を与えることができない単一の値のハッシュすべきですか? – RusAlex

+1

'data':{'id':id} – Amareswar

関連する問題