00、eval转换对象
if ($.type(data) == 'string')
{
data=data.replace(/\s/ig, ' ');
return eval('(' + data + ')');
}
00、序列化表单
json格式: data:$form.serializeArray();
字符串方式:$form.serialize;
00、字符串拼接
1.html=''+
'<td>表格</td>'+
'<td id=" '+iterm.value+' ">'+iterm.anwser+'</td>';
2、事件传参
<!--<a οnmοuseοver="onMouseOverbox2('an_e91c6f66b00840b4963c0415e3aee274',
'ae91c6f66b00840b4963c0415e3aee274_0',this);">
查看
</a>-->
'<a οnmοuseοver="onMouseOverbox2(\' an_ '+questionid+' \',
\' a '+questionid+' _ '+index+' \',this);">'+
'查看</a>'
00、数据循环
result1=[{"addflag":false,"anwser":"d,d","anwser_result":"0","anwser_time":"2013-03-21","history_id":"6334148648eb40298f67fd16c5ea427a","id":"50a6e441a501435595720377b2d72f69","question_id":"f7ad50d52d48480ca21d3be32d4022a0","scores":0,"seq_no":3,"showAll":true,"std_area_id":"3","std_id":"03010701","std_name":"达芬奇","tch_id":"","tch_name":"","tch_scores":0,"tch_suggestion":"","tch_time":"","uncertain_flag":"0"}, {"addflag":false,"anwser":"1,1","anwser_result":"0","anwser_time":"2013-03-21","history_id":"0cf2a2ae37be46eeb19ad505db42d726","id":"a09223db67b5443cabbe928909610286","question_id":"f7ad50d52d48480ca21d3be32d4022a0","scores":0,"seq_no":2,"showAll":true,"std_area_id":"3","std_id":"03010701","std_name":"达芬奇","tch_id":"","tch_name":"","tch_scores":0,"tch_suggestion":"","tch_time":"","uncertain_flag":"0"}]
result2=[{ "addflag":false, "anwser":"<p>\r\n\t1<\/p>\r\n","anwser_result":"0",
"anwser_time":"2013-03-21", "history_id":"0cf2a2ae37be46eeb19ad505db42d726",
"id":"a1f03bb16dfa44e09fe9a43b1d8cca4e", "question_id":"fd4b3956a14244d8a9f10e0fa536792d",
"scores":0,"seq_no":1, "showAll":false, "std_area_id":"3",
"std_id":"03010701", "std_name":"达芬奇", "tch_id":"",
"tch_name":"", "tch_scores":0,
"tch_suggestion":"", "tch_time":"",
"uncertain_flag":"0"}]
questionid='Action 私有属性';
result=eval('(' + result + ')'); $.each(result,function(index,iterm){ if(iterm.showAll){ html=html+'<tr>'+ '<td>'+iterm.anwser_time+'</td>'+ '<td id="a'+questionid+'_'+index+'">'+iterm.anwser+'</td>' '</tr>'; }