var idd ;
var subjects = [];
var ctr = 0;
var teacher = $('#selectTeacher option:selected').text();
for(var j = 0 ; j < lstClasses.length ; j++)
{
var sub = {};
var key = lstClasses[j];
for(var i = 0 ; i < lstSubjects.length ; i++)
{
var id = lstClasses[j] + lstSubjects[i];
var cls = $('#'+id).attr('class');
if(cls.indexOf('tickimage') >= 0)
{
if(ctr == 0)
{
var val = [];
}
ctr = ctr + 1;
idd = id.replace(lstClasses[j], "");
val.push(idd);
/* console.log(val); */
sub[key] = val;
}
/* console.log(sub); */
subjects.push(sub);
}
}
我发送的数据不会以json格式正确后端。我只是想发送特定的类数据及其主题但是在发送数据时它不正常