个人建设广州花都论坛,七彩花都(http://www.w30.cn)包含传值回复楼层的jsonp
可以加入我们的QQ群讨论64674997 专注phonepap
核心加载
jsonp返回格式为
jsonp([{"id":"\u0031","cname":"\u95f2\u804a\u704c\u6c34\u533a\u0020\u82b1\u90fd\u8336\u697c","url":"\u0033","logo":"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0077\u0033\u0030\u002e\u0063\u006e\u002f\u0066\u0069\u006c\u0065\u0073\u002f\u0067\u0072\u006f\u0075\u0070\u0069\u0063\u006f\u006e\u002f\u0032\u0030\u0031\u0034\u0033\u002f\u0078\u0078\u0032\u0030\u0031\u0034\u0030\u0033\u0031\u0038\u0030\u0037\u0033\u0039\u0034\u0038\u002e\u006a\u0070\u0067","content":"\u82b1\u90fd\u704c\u6c34\u8ba8\u8bba\u533a"},{"id":"\u0035","cname":"\u5e7f\u544a\u5ba3\u4f20","url":"\u0035","logo":"\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0077\u0033\u0030\u002e\u0063\u006e\u002f\u0066\u0069\u006c\u0065\u0073\u002f\u0067\u0072\u006f\u0075\u0070\u0069\u0063\u006f\u006e\u002f\u0032\u0030\u0031\u0034\u0033\u002f\u0078\u0078\u0032\u0030\u0031\u0034\u0030\u0033\u0031\u0038\u0030\u0038\u0030\u0035\u0034\u0039\u002e\u006a\u0070\u0067","content":"\u82b1\u90fd\u5e7f\u544a\u5ba3\u4f20"}])
<script type="text/javascript">
$(function(){
$(document).on("click", "#clicks", function() {
_this = $(this);
indexId = _this.attr("did"); //索引ID
localStorage.id=indexId
});
});
$(function(){
$.mobile.loadingMessageTextVisible = true;
$.mobile.showPageLoadingMsg("c", "加载中...");
});
$(
setTimeout(function(){
var tbody = "";
$.ajax({
type : "get",
async:false,
url : "http://www.w30.cn/API/groupall.ashx",
dataType : "jsonp",
jsonp: "callbackparam",//服务端用于接收callback调用的function名的参数
jsonpCallback:"jsonp",//callback的function名称
beforeSend: function (XMLHttpRequest) {},
success : function(json){
$.mobile.hidePageLoadingMsg();
$.each(json,function(i,item) {
var trs = "";
trs += "<dl class=\"contentf\"><dt><h3><a id=\"clicks\" did=\""+item.id+"\" href=\"n.html\" data-ajax=\"false\">"+item.cname+"</a></h3></dt><dd> 发布时间:"+item.addtime+"</dd></dl>";
tbody += trs;
});
$(".contentlist").html(tbody);
},
error:function(){
}
});
},1000))
</script>
源码下载