1、前端:
Ajax.call('order.php?act=export', params, function (data) { document.getElementById("export").disabled = false; document.getElementById("export").value = "导出到Excel"; document.location.href = (data.url); }, 'POST', 'JSON');
2、后端:
$response = array('url' => $fileName,'success'=>true); echo json_encode($response);