$ .post를 보내려면 함수를 작성하고 있습니다. 설정에 따라 객체에 변수를 올바르게 삽입하는 방법을 알려주십시오. 여기 는 내가 할 노력하고있어 무엇 :
function SendCommand(Command, QuestionId, Attr) {
$.post('/survey/admin/command',
{
'Command': Command,
if (QuestionId) 'QuestionId' : QuestionId,
if (Attr) 'Attribute' : Attr
}
);
}
감사합니다!
$.post('/survey/admin/command',
{
'Command': Command,
'QuestionId' : QuestionId ? QuestionId : undefined,
'Attribute' : Attribute ? Attribute : undefined,
}
);
그렇지 않으면, 내가 jQuery를 정의되지 않은 PARAMS을 무시합니다 생각 : null 값의 가능성이 있다면 함께
짧은 있다는 만들 수 있습니다 – alega