2016-12-25 86 views
0

enter image description here如何在通过AJAX请求

enter image description here

这两个图像包含代码JSON响应生成mdbootstrap卡已经与php.What做我想使用JSON response.I生成它要寄给AJAX请求到一个PHP返回给我一个JSON对象。我将解析该对象并显示它。

基本上在图片上面的代码将生成mdbootstrap rotating card .I已放置的根据本result.Suppose卡的代PHP foreach循环是JSON响应

[{"postID":"8","0":"8","userID":"1","1":"1","imagePath":"","2":"","postDate":"18 December 2016","3":"18 December 2016","postDescription":"knds","4":"knds","postUserFullName":"awais2","5":"awais2","type":"image","6":"image"},{"postID":"9","0":"9","userID":"1","1":"1","imagePath":"images\/1-1482062137.jpg","2":"images\/1-1482062137.jpg","postDate":"18 December 2016","3":"18 December 2016","postDescription":"","4":"","postUserFullName":"awais2","5":"awais2","type":"image","6":"image"}] 

我不能追加使用,因为代码差不多127行。给我一些建议。如果我的问题需要修改,请在评论中提出问题。

回答

0

你可以使用jQuery模板,当你收到你在模板的所有者div上添加的响应时。

https://github.com/codepb/jquery-template

+0

嗨,老兄,它看起来像它会为me.It工作是非常困难的,我理解它。我已经试过,但我不能这样做it.Can你帮我做这样很简单的例子“你好,世界'? –