使用变量作为js对象的属性名
<script>
var test={aa:12,bb:34};//或者var test={};
var cc= "acqId"
test[cc]=12;
alert(test[cc])
</script>
使用场景
function objectTest() { var test = { aa: 12, bb: 34 }; var cc = "acqId" test[cc] = 12; $.ajax({ url: xxx/getReslut.htm, type: "GET", data: test, async: true, success: function(result) { alert("success"); } }); }