聯(lián)系官方銷售客服
1835022288
028-61286886
動(dòng)態(tài)調(diào)用模板ajax返回?cái)?shù)據(jù)怎么添加自定義數(shù)據(jù)?
現(xiàn)在動(dòng)態(tài)調(diào)用模板ajax返回json就一個(gè)code和msg, data內(nèi)容就一個(gè)file name 和module. 沒想到什么辦法添加更多的data內(nèi)容.
能不能做成:
被調(diào)用的模板return數(shù)組, 然后返回給ajax? 這樣可以更靈活地自定義返回?cái)?shù)據(jù). 而不是模板只能做為msg返回給ajax的response.
比如我需要返回?cái)?shù)據(jù)(custom1, custom2) 怎么實(shí)現(xiàn):
{
"code":1,
"msg":"xxx",
"data": {"file":"cp_xyft.html","module":"", "custom1":"test1" , "custom2":"test2" , }
}
這是哪個(gè)功能?哪個(gè)教程
回復(fù)迅睿框架創(chuàng)始人
動(dòng)態(tài)調(diào)用模板
http://223987.com/doc/313.html
{
"code":1,
"msg":"xxx",
"data": {"file":"xxx.html","module":"", "custom1":"test1" , "custom2":"test2" , }
}
更新一下程序,刷新一下文檔,做好了
給官方一萬個(gè)贊.