我正在使用 post,而 YUI 文档示例代码不起作用。
YAHOO.util.Event.addListener(window,"load",function()
{
var columnDefs =
[
{key:"url", sortable:true, resizeable:true},
{key:"title", sortable:true, resizeable:true},
{key:"count", sortable:true, resizeable:true}
];
this.dataSource = new YAHOO.util.DataSource("/getallsites/");
this.dataSource.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
this.dataSource.connMethodPost = true;
this.dataSource.responseSchema =
{
fields:["url","title","count"]
};
this.myDataTable = new YAHOO.widget.DataTable("siteTable",columnDefs,this.dataSource,
{initialRequest:"/getallsites/"});
});
/getallsites/ 返回一个 JSARRAY。在将 JSARRAY 转换为 JSON 之前,我想让它工作。Django 服务器日志甚至无法识别对 /getallsites/ 的请求。有任何想法吗?
谢谢!