$.ajax({
type: "POST",
url: '<%= Page.ResolveUrl("~")%>Haggler.asmx/GetFacebookFriends',
//data: jsonText,
contentType: "application/json; charset=utf-8",
dataType: "json",
//'access_token':" + JSON.stringify(access_token) + "
success: function (data) {
var myObject = JSON.parse(eval('(' + data.d + ')'));
var length = myObject.data.length;
alert(length);
//var container = document.getElementById('mfs');
//var mfsForm = document.createElement('form');
//mfsForm.id = 'mfsForm';
// Iterate through the array of friends object and create a checkbox for each one.
for (var i = 0; i < Math.min(myObject.data.length, 10) ; i++) {
htmlT += '<a data-slide-index="' + i + '" href=""><img src="' + myObject.data[i].pic_square + '" /></a>';
// var friendItem = document.createElement('div');
pageIndex = 1;
pageCount = 0;
clearHtml = true;
loadData(myObject.data[i].uid, function (html) { HtmlM += html; });
// HtmlM += loadData(myObject.data[i].uid);
}
$('.bxslider').bxSlider({
pagerCustom: '#bx-pager'
});
$('#reload-slider').click(function (e) {
e.preventDefault();
slider.reloadSlider({
mode: 'fade',
auto: true,
pause: 1000,
speed: 500
});
});
// alert(HtmlM);
$('#bx-pager').html(htmlT);
alert(HtmlM);
$('.bxslider').html(HtmlM);
},
failure: function (data) {
alert(data.d);
},
error: function (msg) {
alert(data.d);
}
});
HTML
<ul class="bxslider">
</ul>
<div id="bx-pager">
</div>
我正在动态生成bxslider内容和寻呼机,但是当我这样做时,bxslider无效。它同时给了我两个li,而不是一个接一个地说。