【发布时间】:2012-08-24 06:29:36
【问题描述】:
这是 email_list 管理控制器页面中的代码:
$idOfCourse = $this->request->data('courseId'); /* 在这两行中,我正在读取从 Js 页面发布的数据*/
$emailArray = $this->request->data('emailList');
这是对应JS中的ajax代码 `var 数据 = { courseId : id, 电子邮件列表:myArray }; //这里我用 2 个字段 courseID 和 emailList 格式化 JSON 格式
$.ajax({ //here I am giving the call
type:"POST",
url :"/adata/admin/email_list",
data: { studentcoursemaildata : data, action : "/adata/admin/template1"}
}).done(function(){
window.location.href ="/admin/email/"; /*I am redirecting after the data is being fetched */
});
`
【问题讨论】:
-
检查控制器中
debug($this->request->data);` 的输出。
标签: jquery cakephp-2.1