以下代码是将页面中的展示部分
代码如下:function searchProductlistByfilterCondition(index, type, sort, filterWord) {
//cite_html
var citem_html = ''
+ ''
+ '{title}'
+ '{time}'
+ ''
+ ''
+ '{mark} {price}'
+ '{praise} '
+ ''
+ ''
+ '{user} '
+ '( 转载- '
+ ' 站酷中国 )'
+ ''
+ ''
+ '
'
+ ' 小海藻 福建 福州 '
+ ' 人气:256
'
+ ' '
+ ' 加关注 '
+ ' 发私信
$.get():从指定的资源请求数据
第一个参数:jSon插件;第二个参数:json数据格式;第三个参数:function(data)方法,data为取得的json数据串
$.each(data.jsona,function(index,elem))
参数说明:
data.jsona:json数据
function(index,elem):
参数说明:
index:索引
elem:相当于json数据串
此后,将html代码添加到页面中。
此方法的作用:
1、传递参数
2、获取
3、展示
接下来在
代码如下:$(function () {
//页面初始化调用
searchProductlistByfilterCondition("", "", "", "");
//查询框,关键字查询--调用函数
$('#search ').click(function () {
pageIndex = 1;
searchProductlistByfilterCondition(pageIndex, sortP, typeL, keyWord);
});
}
页面js中,调用,只需要将具体的数据对应填上就可以了。
页面中的js作用:
1、绑定
2、赋值
希望本文所述对大家的jQuery程序设计有所帮助。