$fileNames = array(); // 是数组,不是字符串
$filesJSON = json_encode($fileNames);// 转成json格式
var oldFiles = new Array();
//oldFiles = '<?php echo $filesJSON;?>';// 这样oldFiles成字符串了,而不是json数据
oldFiles = JSON.parse('<?php echo $filesJSON;?>');// JSON格式即为数组格式
-------------------------------------------------------------------------------------------------
var jsonProps = {
"dispMode":dispMode,
"autoRun":autoRun,
"remark":remark
};
$.ajax({
url:"./process/writeTask.php",
data:"proType=setTask&taskId=" + taskId + "&props=" + JSON.stringify(jsonProps),
$props = json_decode($_REQUEST['props'], true);