我的脚本中没有定义ajax数据
这是我的代码:我的脚本中没有定义ajax数据,ajax,Ajax,这是我的代码: 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
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)}});
它在控制台中获得以下输出:
["2"]
index.phpGET http://127.0.0.4/index.php?r=client/loadOne&undefined=undefined 500 (PHP Error)
我不明白为什么控制台中的id等于“2”,而ajax数据中的id是未定义的 数据应该是散列而不是单个值